Help - Search - Members - Calendar
Full Version: Redirect Stdout
BleepingComputer.com > Software > Programming
   
Billy O'Neal
Hello all! I am looking for someone who knows a little more about the system() call in C++ than I do.

I have written a tool outlined here: http://www.bleepingcomputer.com/forums/ind...logid=1249&
to help around here at BC. I want to convert my tool to C++ instead of batch files. The reason? I need to have string manipulation to par down the event logs to something that fits in a post.

Long story short, in a batch file, I can use the > or >> operators to redirect stdout of a program to a text file. I have already tried something like
CODE
system("ipconfig /all >> c:\report.txt");

and it does not work. sad.gif

Any ideas on redirecting the output of a external program call in C/C++?

Billy3
Billy O'Neal
Alright... I figured it out. Now I want to kick myself. This is wrong:
CODE
system("ipconfig /all >> c:\report.txt");

this is correct
CODE
system("ipconfig /all >> C:\\report.txt");


Thanks anyway all!

Billy3
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.