awips2/edexOsgi/com.raytheon.edex.uengine/scripts/scriptExecute.js
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

31 lines
No EOL
822 B
JavaScript

/* class constructor */
function ExecuteApplication() {
this.timeout = 10;
this.command = "";
}
/* main action method */
function _execute() {
var executer = new ExecuteCommand(this.command,this.timeout);
var result = executer.execute();
return result;
}
/* class setters */
function _setTimeOut(time) {
this.timeout = time * 1000;
}
function _setCommandLine(commandLine) {
this.command = commandLine;
}
/* add methods to class */
ExecuteApplication.prototype.execute = _execute;
ExecuteApplication.prototype.setTimeOut = _setTimeOut;
ExecuteApplication.prototype.setCommandLine = _setCommandLine;
/* short form of the script */
var runner = new ExecuteApplication();
runner.setTimeOut(10000);
runner.setCommandLine("D:/bin/TestScript.bat This is a test");
runner.execute();