以前管理计算机 机房时需要修改学生机卷标名,有50台计算机,手动改太麻烦了,于是就写了个VC程序,很简单,就是调用了一个Win32API:)
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
#include <conio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
if(argc<3)
{
printf("Usage: \n setvolume <letter:> <volumelabel>\n Author :Mr.wu");
exit(0);
}
if(SetVolumeLabel(argv[1],argv[2])==0)
{
printf("%s,%s Error occurred! error code = %d",argv[1],argv[2],GetLastError());
printf("Press any key to exit");
getche();
}
return 0;
}
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
#include <conio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
if(argc<3)
{
printf("Usage: \n setvolume <letter:> <volumelabel>\n Author :Mr.wu");
exit(0);
}
if(SetVolumeLabel(argv[1],argv[2])==0)
{
printf("%s,%s Error occurred! error code = %d",argv[1],argv[2],GetLastError());
printf("Press any key to exit");
getche();
}
return 0;
}