I believe I saw this topic before but I cannot see any suggested
solution.
My question is:

I got a vbs script that runs perfectly if I execute in a cmd shell

cscript sample.vbs > outfile

All output is captured in the outfile.

If I put the same line in a schedule task, the task will be executed
but no output is captured in the outfile. How can I overcome this?

Thanks for any suggestion.

PS. Please do not suggest amending the vbs script itself to capture the
output. This is not a solution.

Re: running a vbs script in scheduled task by Michael

Michael
Fri Jan 26 18:40:36 CST 2007

akkha1234@gmail.com wrote:
> I believe I saw this topic before but I cannot see any suggested
> solution.
> My question is:
>
> I got a vbs script that runs perfectly if I execute in a cmd shell
>
> cscript sample.vbs > outfile

cmd.exe /c cscript sample.vbs > outfile


>
> All output is captured in the outfile.
>
> If I put the same line in a schedule task, the task will be executed
> but no output is captured in the outfile. How can I overcome this?
>
> Thanks for any suggestion.
>
> PS. Please do not suggest amending the vbs script itself to capture
> the output. This is not a solution.

--
Michael Harris
Microsoft.MVP.Scripting



Re: running a vbs script in scheduled task by Yann

Yann
Fri Jan 26 19:36:00 CST 2007

... or create a simple batch file calling the vbscript.
In the scheduler, type in the command to run: myBatch.bat > myLog.log

That's what I'm doing with my vbscripts.

"Michael Harris (MVP)" wrote:

> akkha1234@gmail.com wrote:
> > I believe I saw this topic before but I cannot see any suggested
> > solution.
> > My question is:
> >
> > I got a vbs script that runs perfectly if I execute in a cmd shell
> >
> > cscript sample.vbs > outfile
>
> cmd.exe /c cscript sample.vbs > outfile
>
>
> >
> > All output is captured in the outfile.
> >
> > If I put the same line in a schedule task, the task will be executed
> > but no output is captured in the outfile. How can I overcome this?
> >
> > Thanks for any suggestion.
> >
> > PS. Please do not suggest amending the vbs script itself to capture
> > the output. This is not a solution.
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
>
>
>