Skip to content

Instantly share code, notes, and snippets.

@mattcuk
Created October 26, 2020 11:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattcuk/ad9801555be47fb87f53d0b74ecd31c8 to your computer and use it in GitHub Desktop.
Save mattcuk/ad9801555be47fb87f53d0b74ecd31c8 to your computer and use it in GitHub Desktop.
Example multi-line registry entry for USB Detect & Launch
set ShellObj = CreateObject("WScript.Shell")
ShellObj.RegWrite "HKCU\Software\VB and VBA Program Settings\USBDetector\Settings\Advanced", "label:(any)" & vbCrLf & "exec:""C:\App\USB-Warning.bat"" ""%1""" & vbCrLf & "ignore:c:\", "REG_SZ"
ShellObj.RegWrite "HKCU\Software\VB and VBA Program Settings\USBDetector\Settings\Interval", "10", "REG_SZ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment