Created
December 9, 2012 20:40
-
-
Save xcriptus/4246883 to your computer and use it in GitHub Desktop.
StarUML - Shell Execution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Execution through Shell.Application | |
var shell = new ActiveXObject("Shell.Application") ; | |
shell.ShellExecute("cmd arg1 arg2 ...") | |
//--- Execution through WScript | |
var shell = new ActiveXObject("WScript.Shell"); | |
// Execute the command | |
ws.run( "notepad.exe foo.txt") ; | |
// Execute and wait for the output and errors | |
var cmd = "myCommand arg1 arg2 arg3" ; | |
var errcode = shell.Run("%comspec% /c "+cmd+" 1>"+outfile+" 2>"+errfile,0,true) ; | |
//--- Getting the parameters of command line when called from wscript | |
// WScript thisscript.js arg0 arg1 arg2 | |
var shell = new ActiveXObject("WScript.Shell"); | |
var nbargs=WScript.Arguments.Length ; | |
var arg1=WScript.Arguments.Item(0) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment