Skip to content

Instantly share code, notes, and snippets.

@davidruhmann
Created January 24, 2013 16:57
Show Gist options
  • Save davidruhmann/4625071 to your computer and use it in GitHub Desktop.
Save davidruhmann/4625071 to your computer and use it in GitHub Desktop.
[Batch] Hidden CMD Window
:: Save this one line of text as file invisible.vbs:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
:: To run any program or batch file invisibly, use it like this:
wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"
:: To also be able to pass-on/relay a list of arguments use only two double quotes
CreateObject("Wscript.Shell").Run "" & WScript.Arguments(0) & "", 0, False
:: eg: Invisible.vbs “Kill.vbs ME.exe”
:: http://www.howtogeek.com/131597/can-i-run-a-windows-batch-file-without-a-visible-command-prompt/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment