Disable USB port from access smart-phone memory (without Group policy) in C#

  • Thread starter Thread starter Prajith C S
  • Start date Start date
P

Prajith C S

Guest
Hi I am currently working on an application to Disable/Enable USB port programmatically in C#

I have found the following code snippet to Enable/disable the USB port. It's working fine with normal USB Sticks. But unfortunately its not disabling the Smartphone's memory card access

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

//enable USB storage...
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord);

I have googled for a better solution to solve this issue. I found some suggestions to use group policy for achieve the same. But my application is not intent to use the group policies. SO is there any solution is available like edit any registry key to achieve the Smart phone's memory access restriction programmaticaly in c#?

Continue reading...
 


Write your reply...
Back
Top