想要禁用USB可以使用組策略編輯器中的安全設置,如果你需要使用注冊表來禁用USB端口,那么下面分享給大家比較簡單的教程,包含了禁用USB端口和啟用USB端口。方便大家在電腦上限制USB的使用,有需要的朋友可以一試。
注冊表禁用USB端口:
方法:將如下代碼復制到一個文本文件里面,然后保存為XXX.reg注冊表文件然后雙擊導入就可以了!
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"Type"=dword:00000001
"Start"=dword:00000004
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\
00,52,00,2e,00,53,00,59,00,53,00,00,00
"DisplayName"="USB 大容量存儲設備"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]
"Count"=dword:00000000
"NextInstance"=dword:00000000
注冊表啟用USB端口:
方法:將如下代碼復制到一個文本文件里面,然后保存為XXX.reg就OK了!
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
"Type"=dword:00000001
"Start"=dword:00000003
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\
00,52,00,2e,00,53,00,59,00,53,00,00,00
"DisplayName"="USB 大容量存儲設備"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]
"Count"=dword:00000000
"NextInstance"=dword:00000000
大家有沒有發現其實這兩個代碼幾乎一樣,只是在"Start"=后面的內容稍有變動,開啟的是"Start"=dword:00000003,禁用的是"Start"=dword:00000004 也可以手動操作如下教程
1、按下Win+R,輸入:regedit 啟動注冊表編輯器;

2、依次展開如下分支:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentCntrolSet\services\USBSTOR]

3、在右側的窗格中找到名為“Start”的DWORD值,雙擊,在彈出的編輯對話框中將其數值數據修改為十六位進制數值“4”。

4、點“確定”按鈕并關閉注冊表編輯器,重新啟動計算機,使設置生效。重啟后,當有人將USB存儲設備連接到計算機時,雖然USB設備上的指示燈在正常閃爍,但在資源管理器當中就是無法找到其盤符,因此也就無法使用USB設備了,等同于被認為禁用USB。
以上方法大家可以自由選擇都是比較簡單的哦。