does anyone here know how to make the csript.exe run in silent mode? I have
to run a script using cscript.exe from a setup program, but it always comes
up with a DOS prompt. Thanks!
- Emily Chang
cscript //b //nologo "scriptname"
If you want to prevent a DOS window from opening when your run it, then you
need to deal with that in your setup application (for example, launching an
application in a hidden window). You could do this in WSH:
' Run script in invisible window and wait until script is complete
WSShell.Run "cscript //b //nologo myscript.vbs", 0, True
Hope this helps.
Michael
"Totoro" <emil...@yahoo.com> wrote in message
news:ehXQKkUu$GA.259@cppssbbsa05...
var Shell = new ActiveXObject("WScript.Shell");
var ScriptPath = 'cscript "' + WScript.ScriptFullName + '" '
if(WScript.FullName.toLowerCase().indexOf("wscript.exe") >-1)
{
var Arguments = new String();
for(var Arg = 0; Arg < WScript.Arguments.Length; Arg++)
{
WScript.Arguments(Arg).indexOf(" ") == -1 ?
Arguments += WScript.Arguments(Arg) + " " :
Arguments += '"' + WScript.Arguments(Arg) + '" '
}
Shell.Run(ScriptPath + Arguments,0)
WScript.Quit();
}
///Place remainder of script here, which will now be running
///under an hidden instance of cscript.exe.
:
: