Sorry to ask, if am not violating the policy here: I need source code to enable and disable USB with a button using vb.net. The one have tried creating doesn't to work. Thank you
Sorry to ask, if am not violating the policy here: I need source code to enable and disable USB with a button using vb.net. The one have tried creating doesn't to work. Thank you
Hi @WilfredEghenedji-9495 ,
Also consider changing the registry value:
' 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)
Make sure you have administrator privileges.
Best Regards,
Xingyu Zhao
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
With SetupDiSetClassInstallParams + SetupDiCallClassInstaller in x64
Many samples on Google
9 people are following this question.