How To Block And Unblock USB Using VB.NET

this is something very interest but this is the best way to lock usb and unblock usb because i am using registry so anyone can change the registry by the way lets just make it

you will need two buttons thats it

button1 - block
button2 - unblock

now double click your button1 and add this code


   My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "00000001", Microsoft.Win32.RegistryValueKind.DWord)

now double click your button and add this code at last

  My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "00000000", Microsoft.Win32.RegistryValueKind.DWord)

done

4 comments

Is there any way to block only one usb port

Reply

same question as mustafa any way to block only one port?

Reply

the code is not working

Reply

code not working

Reply

Post a Comment

Note: Only a member of this blog may post a comment.