Write Run Program output to text file

Got a problem you cannot solve? Try here.
Post Reply
anj2005
Posts: 2
Joined: Mon May 25, 2009 1:58 pm

Write Run Program output to text file

Post by anj2005 »

Hi,

I want to use the output of a Run Program command to write to a text file. Specifically, I want to call mysqldump and write to a .sql file in order to back up the program's database. I am calling the command:
mysqldump -[all the parameters] > filename.sql.

If I don't add the > filename.sql, then I can see the cmd box with the proper script results flowing through so I know the mysqldump command is executing. But adding the > filename.sql gives me no result. The file does not save to the mysqldump directory. Even if I specify a full path such as > C:\\filename.sql no file shows up either.

How can I get the Run Program output to write to a file?

Thanks
Alex




[quote][/quote]
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Output redirection/piping is not a feature of the CreateProcess/ShellExecute Windows APIs that Run Program uses, but a part of the cmd.exe system shell interpreter.

You will want to run cmd.exe directly instead! See the sticky post in this forum.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
anj2005
Posts: 2
Joined: Mon May 25, 2009 1:58 pm

Post by anj2005 »

Using cmd with the /c option worked.

Thanks!
Alex
Post Reply