forums Computer Tutorials Computer Help and Spyware Removal File DatabaseUninstall Database Windows Startup Programs Database Computer Resources Computer Glossary Forums Computer Help and Spyware Removal
 

Welcome Guest ( Log In | Click here to Register a free account now! )



Register a free account to unlock additional features at BleepingComputer.com
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

 
Reply to this topicStart new topic
> Redirect Stdout
Billy O'Neal
post Apr 15 2008, 09:51 PM
Post #1


Big Brother is Watching You
******

Group: HJT Senior Classmen
Posts: 1,713
Joined: 17-January 08
From: Airstrip One
Member No.: 184,215



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


--------------------
In the event I fail to reply within twenty-four hours, feel free to send me a PM.
Have I helped you? If so, please sign My Guestboox to help me get into college!
Join BC.com's Folding Team (#38444)! Help Stanford University find a cure for diseases!
Go to the top of the page
 
+Quote Post
Billy O'Neal
post Apr 16 2008, 04:56 PM
Post #2


Big Brother is Watching You
******

Group: HJT Senior Classmen
Posts: 1,713
Joined: 17-January 08
From: Airstrip One
Member No.: 184,215



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


--------------------
In the event I fail to reply within twenty-four hours, feel free to send me a PM.
Have I helped you? If so, please sign My Guestboox to help me get into college!
Join BC.com's Folding Team (#38444)! Help Stanford University find a cure for diseases!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 5th July 2008 - 04:55 PM


Advertise   |   About Us   |   Terms of Use   |   Privacy Policy   |   Contact Us   |   Site Map   |   Chat   |   Tutorials   |   Uninstall List
Discussion Forums   |   The Computer Glossary   |   Resources   |   RSS Feeds   |   Startups   |   The File Database   |   Malware Removal Guides

© 2003-2008 All Rights Reserved Bleeping Computer LLC.