Forum Discussion
HKosova
Alumni
12 years agoExec always shows the console window.
But if you don't need to access StdIn/StdOut/StdErr streams, you can use Run. It hides the console window if you set the 2nd parameter to 0:
But if you don't need to access StdIn/StdOut/StdErr streams, you can use Run. It hides the console window if you set the 2nd parameter to 0:
var WScriptObj = Sys.OleObject("WScript.Shell");
// Run the command and wait for completion
WScriptObj.Run("...", 0, true);
// Run the command but don't wait for completion
WScriptObj.Run("...", 0, false);