Skip to content

Instantly share code, notes, and snippets.

@17
Last active August 29, 2015 13:55
Show Gist options
  • Save 17/8727266 to your computer and use it in GitHub Desktop.
Save 17/8727266 to your computer and use it in GitHub Desktop.
hrun.vbs is a command utility, that allows you to run multiple apps and commands without any window in the background.
@echo off
cscript hrun.vbs "cmd /c ipconfig /all >result.txt" >nul
pause
dim oArgs, oShell, iCountArgs
set oArgs = wscript.Arguments
set oShell = CreateObject("WScript.Shell")
iCountArgs = oArgs.Count
if iCountArgs < 1 then
wscript.echo "Error: Too few arguments"
wscript.quit
end if
for iIndex = 0 to iCountArgs - 1
oShell.run oArgs(iIndex), 0
next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment