Torgeir
Sat Oct 30 04:34:09 CDT 2004
Michael Harris (MVP) wrote:
>>I solve this type of problem by adding a command line parameter
>>to the script, and then let the script check is this parameter
>>is there or not.
>>
>>So you could then start your scheduled script e.g. like this:
>>
>>wscript.exe "c:\scripts\some.vbs" scheduled
>
>
> You can also use the //B (batch) host switch for the scheduled version.
>
> wscript.exe //B "c:\scripts\some.vbs"
>
> When //B is used WScript.Interactive returns false.
>
> The downside is that //B suppresses all wscript.echo output, so it wouldm't
> be appropriate if the command line used %comspec% and > stdout redirection.
> A workaround in that case is to use wscript.stdout.writeline which isn't
> suppressd by //B.
>
Very good tip, Michael :-)
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx