當(dāng)然,你也可以完全使用BAT操作注冊表來完成修改注冊表的鍵值的目的,具體方式留以后完善,如果你有好的想法,記得告訴我哦!
USB_Disable.bat文件代碼:
代碼如下:
@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文件,可以雙擊運(yùn)行。
更多信息請查看IT技術(shù)專欄