I'm a pragmatist and just changed to Exec, StdOut.ReadAll and a file write to get what I wanted, but for future ref. does anyone know why using Run like this doesn't work?
x.Run("fred.exe inputfile > outputfile", 0, true);
That's jscript, but I imagine the issue is generic. The exe runs and if I change that 0 to 1 I get to see a transient dos box in which I see the output i.e. the redirect to file doesn't happen![]()
Ah ha! If you want stdout redirection to work you have to do it something like this:
x.Run("%comspec% /c fred.exe inputfile > outputfile", 0, true);
If I am doing a complicated command line I tend to find things work easier if I put that into a string and then use that eg
Code:myCmd= "%comspec% /c fred.exe inputfile > outputfile" x.Run(myCmd,0, true);
There are currently 1 users browsing this thread. (0 members and 1 guests)