Forum Discussion
MW_Didata
7 months agoRegular Contributor
Function RunBatch(BatFile, WaitJN)
'Run the command and wait for completion
'Parameters : File, Size&state of window, Wait for completion
RunBatch= Sys.OleObject("WScript.Shell").Run ((BatFile), 1, (WaitJN))
End Function
I use this for running Batchfiles, This way I can use the (WaitJN) parameter to either wait for the batch to be done or run it while TC does other things.
EDIT: I posted the VBScript code, For JavaScript I use this one:
function RunBatch(Batfile, WaitJN)
{
Log.Message("Running Batchfile '" + (Batfile) + "'", "");
Sys.OleObject("WScript.Shell").Run ((Batfile), 1, (WaitJN))
}
The parameters work the same.
- torus7 months agoContributor
To anyone else who comes to this discussion, MW_Didata's example is VBScript. Thanks MW_Didata for the information and example code!
- MW_Didata7 months agoRegular Contributor
oops you're right, I meant to post this one
function RunBatch(Batfile, WaitJN) { Log.Message("Running Batchfile '" + (Batfile) + "'", ""); Sys.OleObject("WScript.Shell").Run ((Batfile), 1, (WaitJN)) }
Related Content
- 7 years ago
- 8 years ago
Recent Discussions
- 2 days ago
- 7 days ago
- 11 days ago