完全禁用USB端口 [英] Disable USB ports completely
问题描述
有没有办法禁用所有USB端口,因此它无法识别任何可移动存储设备或任何其他设备
(USB鼠标,USB键盘等等)。
谢谢。
我的尝试:
我尝试过以下方法
1.更改USBSTOR注册表值
2.启用组策略所有可移动存储类:拒绝所有访问
以上方法仅禁用可移动存储,但不禁用其他设备。
任何帮助都是赞。
Quote:使用设备管理器禁用并重新启用所有USB控制器
您可以使用 Windows设备控制台(Devcon.exe) - Windows 10硬件开发 [ ^ ]实用程序(可用源代码)。
有禁用USB设备的示例:设备控制台(DevCon.exe)示例 - Windows 10硬件开发 [< a href =https://msdn.microsoft.com/en-us/library/windows/hardware/ff544746(v=vs.85).aspx#ddk_example_30_disable_devices_by_an_id_pattern_tools\"target =_ blanktitle =New Window> ^ 。禁用内部USB根集线器时,无法连接任何设备。
用于禁用USB,您需要以编程方式更改注册表值。以下是代码
禁用USB
Microsoft.Win32 .Registry.SetValue( @ HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet \ Services \ USBSTOR, 启动, 4 ,Microsoft。 Win32.RegistryValueKind.DWord);
用于启用USB。
Microsoft.Win32.Registry.SetValue( @ HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet \ Services \ USBSTOR, 启动, 3 ,Microsoft.Win32.RegistryValueKind.DWord );
Hi,
Is there a way to disable all USB ports, so that it does not recognize any removable storage or any other device
(USB mouse, USB keyboard etc).
Thank you.
What I have tried:
I have tried the below methods
1. Make changes to USBSTOR registry value
2. Enable the group policy "All Removable Storage classes: Deny all access"
The above methods disable only the removable storage, but not other devices.
Any help is appreciated.
Quote:Use Device Manager to disable and re-enable all the USB controllers
You can use the Windows Device Console (Devcon.exe) - Windows 10 hardware dev[^] utility (source code available).
There are examples to disable USB devices: Device Console (DevCon.exe) Examples - Windows 10 hardware dev[^]. When disabling the internal USB root hubs, no devices can be connected.
for disable USB you need to change registry values programmatically. following is the code
For disable USB
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord);
For enable USB.
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord);
这篇关于完全禁用USB端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!