By Dali-Inc SoftwaresCreated 03 Jan 2012, Modified 05 Jan 2012
My Rating:
Vote
Rating:
Not Rated
Views:6112
Downloads:132
Source:

Usb Port lock

Language:  VB

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 Yes Windows NT Yes
Vista Yes Windows 2008 Yes
Description

Enable and Disable USB ports.. Run as admin on vista and above

Code

Line Numbers: On  Off      Plain Text
'------------------ENABLE PORTS---------------------------------------------
Private Sub Command1_Click()
On Error Resume Next
Set objReg = CreateObject("Wscript.shell")
    objReg.Regwrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\Start", 3, "REG_DWORD"
MsgBox "Usb Port have being Enabled Sucessfully,Please Remove the USB and Replug it..", vbInformation
End Sub

'------------------DISABLE PORTS---------------------------------------------
Private Sub Command2_Click()
On Error Resume Next
If MsgBox("Are you sure you want to disable usb ports?", vbQuestion + vbYesNo) = vbYes Then
    Set objReg = CreateObject("Wscript.shell")
    objReg.Regwrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\Start", 4, "REG_DWORD"
MsgBox "USB Ports have being disabled sucessfully", vbInformation
End
Else
End If
End Sub

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
Be the first to post a comment!