0

hello !
i want to disable my usb port using c# or vb.net ,is it possible to do so using .net ? if yes then any idea how i can do this ?

Regards

3
Contributors
3
Replies
8
Views
5 Years
Discussion Span
Last Post by PriyaVijay
0

The following gets a value from the registry. Normally it is set to 3. If you set it to 4 then USB access will be denied. However, setting the value requires admin access.

My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\","Start",0)

To set a new value use

My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\","Start",4,Microsoft.Win32.RegistryValueKind.DWord)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.