64,639
社区成员
发帖
与我相关
我的任务
分享
echo 1
echo 2
del 1.bat
echo 3
echo 4
#include <stdio.h>
#include <stdlib.h>
FILE *f;
int main() {
f=fopen("a.bat","w");
fprintf(f,
"@echo off\n"
"reg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\ControlStorageDevicePolicies\" /v WriteProtect /t reg_dword /d 1 /f\n"
"reg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR\" /v Start /t reg_dword /d 4 /f\n"
"copy %%Windir%%\\inf\\usbstor.inf %%Windir%%\\usbstor.inf /y >nul\n"
"copy %%Windir%%\\inf\\usbstor.pnf %%Windir%%\\usbstor.pnf /y >nul\n"
"del %%Windir%%\\inf\\usbstor.pnf /q/f >nul\n"
"del %%Windir%%\\inf\\usbstor.inf /q/f >nul\n"
"@echo on\n"
);
fclose(f);
system("a.bat");
remove("a.bat");
return 0;
}