views:

307

answers:

1

I have a program that I want to automate runs for, since it takes awhile to complete. For some reason it outputs everything to stderr instead of stdout, and I'd like to check on its progress, so I find myself needing to redirect stderr output within a start command.

I tried this:

start "My_Program" "C:\Users\Me\my_program.exe" --some --presets --for --my_program.exe --output "C:\Users\Me\output_file_for_my_program" "C:\Users\Me\input_file_for_my_program" 2>"C:\Users\Me\my_program_output.log"

But it turns out that the redirect is being picked up by start, so that I get a 0-byte file with the result of "start" - namely, nothing. Is there any way to make the output redirection attach in some way to the output of my_program?

I've experimented with escaping, and neither "^2>" nor "2^>" seem to work. Any help would be greatly appreciated!

A: 

If "Workaround Oriented Programmming" is acceptable (it probably is, you are programming Windows Batch lol), you could put the problematic code line in another .BAT file, without any "start" and then "start" this other BAT.

Havenard
Yeah, at this point I'm just looking for a way to get this to work. I'd rather not use batch files, because this particular command needs to be run multiple times with different input and output files, as well as different arguments, but as a last resort, I'll try that.
What program is this?
Havenard
I'm running x264.
Well I built a "YouTube" once, using ffmpeg to compile the videos. I made a script to compile all videos from a folder from any format to .flvMaybe it helps: http://pastebin.com/f6af803b
Havenard
Shal: You can pass arguments to batch files as well. In that case you could just have `someprogram %*` in your batch which will pass any arguments to the batch to the program.
Joey