@echo off echo On Error Resume next>USB_Disable.vbs echo Dim WshShell>>USB_Disable.vbs echo Set WshShell = WScript.CreateObject("WScript.Shell")>>USB_Disable.vbs echo wshShell.RegWrite "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/USBSTOR/start", 4, "REG_DWORD">>USB_Disable.vbs
cSCript USB_Disable.vbs del USB_Disable.vbs pause
USB_Enable.bat文件代码:
复制代码 代码如下:
@echo off echo On Error Resume next>USB_Enable.vbs echo Dim WshShell>>USB_Enable.vbs echo Set WshShell = WScript.CreateObject("WScript.Shell")>>USB_Enable.vbs echo wshShell.RegWrite "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/USBSTOR/start", 3, "REG_DWORD">>USB_Enable.vbs
cSCript USB_Enable.vbs del USB_Enable.vbs pause
把以上两段代码保存为bat文件,可以双击运行。
您可能感兴趣的文章:
用vbs实现本地连接禁用/启用脚本代码用vbs实现禁用服务vbscript禁用 启用fso的方法使用 iisext.vbs 禁用 Web 服务扩展的方法使用VBS禁用、启动USB存储设备VB实现禁用任务管理器的方法