Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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.
Posted
Updated 21-Mar-16 2:15am
Comments
Philippe Mori 21-Mar-16 12:13pm    
This is very suspicious... How would you use the computer without keyboard. We don't need your viruses!

If this is for a public computer, then remove physical ports...
Saiprasad V 22-Mar-16 1:41am    
I guess you got confused with the examples. My intent is just disable the USB port so that no device can be connected. I may use the touchscreen input if required. And believe me its no virus:-)
Philippe Mori 22-Mar-16 8:24am    
And if the screen breaks? And how would you know that no internal peripherical are USB?

Quote:
Use Device Manager to disable and re-enable all the USB controllers
https://support.microsoft.com/en-gb/kb/817900[^]
 
Share this answer
 
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.
 
Share this answer
 
for disable USB you need to change registry values programmatically. following is the code


For disable USB
C#
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord);

For enable USB.
C#
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord);
 
Share this answer
 
Comments
Jochen Arndt 21-Mar-16 8:20am    
The poster already knows that:

"1. Make changes to USBSTOR registry value"

"The above methods disable only the removable storage, but not other devices."
Manoj Kumar Choubey 21-Mar-16 22:30pm    
ok Jochen Thank you for suggest
Member 14710287 30-Mar-22 17:36pm    
hi how can I disable some kind of USB Reader.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900