Skip to content

Instantly share code, notes, and snippets.

@vlakoff
Created May 11, 2015 07:51
Show Gist options
  • Save vlakoff/2f83ddaa0053449fc3fd to your computer and use it in GitHub Desktop.
Save vlakoff/2f83ddaa0053449fc3fd to your computer and use it in GitHub Desktop.
Call a Windows batch file without showing the console window
' taken from FreeFileSync - www.freefilesync.org
set argIn = WScript.Arguments
num = argIn.Count
if num = 0 then
WScript.Echo "Call a Windows batch file (*.cmd, *.bat) without showing the console window" & VbCrLf & VbCrLf &_
"Command line:" & VbCrLf & "WScript HideConsole.vbs MyBatchfile.cmd <command line arguments>"
WScript.Quit 1
end if
argOut = ""
for i = 0 to num - 1
argOut = argOut & """" & argIn.Item(i) & """ "
next
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run argOut, 0, True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment