Link to home
Start Free TrialLog in
Avatar of andrew_89
andrew_89

asked on

Redirect cmd output to another file via unc paths

I have a vbsciprt that is calling a shell :

Set objShell = CreateObject("Wscript.Shell")
objShell.Run "<\\UNCPATHC\test.vbs  -output > <\\UNCPATH\test.txt"

The script calls the perl file but I cant get it to write the output to the test file which is also a UNCpath. How do I get the out from this vbscript to write to a file using UNC paths??


Thanks
Avatar of andrew_89
andrew_89

ASKER

correction on above

objShell.Run "<\\UNCPATHC\test.vbs  > <\\UNCPATH\test.txt"
Ok sorry for the confusion here. I am simply trying to spawn a shell , run a script on UNC path and capture the output to another static file.....l
I have found the solution . Jsut need to use comspec as you see below and output redirects with no problem.


objShell.Run "%comspec% /c <\\UNCPATHC\test.vbs  > <\\UNCPATH\test.txt"
Avatar of RobSampson
Andrew,

Well done on finding your solution.

To have this question PAQed or deleted, please post a request in the Community Support zone to that effect, including the link to this question.

Regards,

Rob.
   *  Root zones can not have questions posted to them. "Community Support" is a root zone.

hmm , what am I doing wrong as I am trying to get this closed.
Try the Community Support --> General zone...

Regards,

Rob.
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial