wscript.Run does not work in a scheduled environment
Posted on 2006-03-22
I wrote a vbscript that works when called from the command line - that is:
But does not work when called from a scheduler; where it is executing under an ID that does not have access to the console. (In fact - the machine is logged off.)
My code is:
set Shell = WScript.createobject("wscript.shell")
Command = "c:\sqldata\mssql\scripts\wget -q " & SourceFile & " -O " & TargetFile
ReturnCode = Shell.run(Command, 0, TRUE)
If ReturnCode > 0 Then
The return code I am getting from shell.run is 1.
How can I do a shell command to run a task completely in the background?