.如果真 (信息框 (“运行本程序将禁用USB,禁用组策略,禁用注册表,您是否继续?”, #是否钮, ) = #否钮)
返回 (0)
.如果真结束
写注册项 (#现行用户, “Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools”, 1)
写注册项 (#现行用户, “Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}\Restrict_Run”, 1)
写注册项 (#本地机器, “SYSTEM\CurrentControlSet\Control\StorageDevicePolicies\WriteProtect”, 1)
写注册项 (#本地机器, “SYSTEM\CurrentControlSet\Services\USBSTOR\Start”, 4)
配置文件 = 读环境变量 (“SYSTEMROOT”) + “inf\usbstor.inf”
写配置项 (配置文件, “USBSTOR.AddService”, “ServiceBinary”, “ %12%\USBSTORA.SYS”)
写配置项 (配置文件, “USBSTOR.AddService”, “StartType”, “ 4”)
写配置项 (配置文件, “USBSTOR.AddService”, “ServiceType”, “ 32”)
写注册项 (4, “SYSTEM\CurrentControlSet\Services\USBSTOR\ImagePath”, “system32\DRIVERS\USBSTORA.SYS”)
盘符 = { “A”, “B”, “C”, “D”, “E”, “F”, “G”, “H”, “I”, “J”, “K”, “L”, “M”, “N”, “O”, “P”, “Q”, “R”, “S”, “T”, “U”, “V”, “W”, “X”, “Y”, “Z” }
硬盘数组 = 取驱动器列表 (1)
.计次循环首 (26, 计次)
.如果真 (盘符是否存在数组里 (盘符 [计次], 硬盘数组) = 假)
a = a + 转换 (盘符 [计次])
.如果真结束
.计次循环尾 ()
写注册项 (#本地机器, “SoftWare\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDrives”, 到字节集 (a))
写注册项 (#本地机器, “SoftWare\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewOnDrive”, 到字节集 (a))
上一篇 线程返回数据有效的方法