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)
Reverend Jim
Carpe per diem
3,600 posts since Aug 2010
Reputation Points: 561
Solved Threads: 447
Skill Endorsements: 32
Question Answered as of 9 Months Ago by
Reverend Jim