I got this problem while trying to disable or enable ports. It works well when Im using my friend's laptop but when I tried using my laptop, it give this error. Why was this happen and how to solve it? Thanks ^^
Private Sub DisableBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisableBtn.Click
Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord) 'this line gives error
MessageBox.Show("Port are disable", "USB Disable", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Hide()
Login.Show()
End Sub
Private Sub EnableBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnableBtn.Click
Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord) 'this line gives error
MessageBox.Show("Port are enable", "USB Enable", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Hide()
Login.Show()
End Sub