注册表禁用和启用USB端口

USB端口禁用
把下面代码另存为文件:USB_Disable.bat
cSCript \\AppServices\netlogon\USB_Disable.vbs
--------------------------------------------------
把下面代码另存为文件:USB_Disable.vbs
On Error Resume next
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\start", 4, "REG_DWORD"

=================================================================================

USB端口启用
把下面代码另存为文件:USB_Enable.bat
cSCript \\AppServices\netlogon\USB_Enable.vbs
--------------------------------------------------
把下面代码另存为文件:USB_Enable.vbs
On Error Resume next
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\start", 3, "REG_DWORD"

说明:直接执行以上的两个bat文件就可以了,文件路径自己改下!

posted on 2013-08-22 11:55  jack_Meng  阅读(5780)  评论(0编辑  收藏  举报

导航