Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created May 20, 2013 19:35
Show Gist options
  • Save bdkosher/5614834 to your computer and use it in GitHub Desktop.
Save bdkosher/5614834 to your computer and use it in GitHub Desktop.
A JScript snippet for launching a Windows batch file (replace {BATCHFILENAME} with the name of your batch file, which should be on %PATH%). Create shortcuts with the JScript file as the target; this allows you to launch the batch files sans command prompt window using the shortcut.
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c {BATCHFILENAME}.bat", WindowStyle_Hidden)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment