Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting output using Wscript.Run, doesn't work!

Status
Not open for further replies.

wolfsteven

Programmer
Jul 26, 2007
2
US
Here is my sample code:

oShell.Run cProgram & " >" & cFile, nWindowType, True

However, the file isn't created.

The weird thing is that it was working for a while but then stopped. Permissions maybe?
 
Perhaps this ?
oShell.Run "CMD /C " & cProgram & " >" & cFile, nWindowType, True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes. Command line redirection requires a command line processor to preprocess the command and act on it. That's why you need to run Cmd.exe and pass your command line string to it for action if you use Cmd.exe directives like the redirection syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top