Submitted By: Cesar Gabardo
Disables USB storage devices, but does not affect other USB devices.
const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." 'Set StdOut = WScript.StdOut Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SYSTEM\CurrentControlSet\Services\USBSTOR" strValueName = "Start" dwValue = 4 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." 'Set StdOut = WScript.StdOut Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SYSTEM\CurrentControlSet\Services\USBSTOR" strValueName = "Start" dwValue = 4 oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue