|
-
February 4th, 2011, 01:37 PM
#16
Re: Read Dos Out put
Strangely enough I needed to do this today! I was running a DOS applicartion that was printing some error message in its console and then immediately aborting (taking the console down with it). Let's say your DOS app is called "app" and you want to see its output in a file called "file.txt". Just run the application from a command prompt by typing app > file.txt You'll then be able to open file.txt in any text editor and view the output. There's probably a way to do this programmatically too but I don't know what it is.
The '>' symbol BTW is called a pipe if I remember correctly.
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
February 4th, 2011, 01:49 PM
#17
Re: Read Dos Out put
 Originally Posted by John E
The '>' symbol BTW is called a pipe if I remember correctly.
I always thought that pipe is '|'. 
And passing "app > file.txt" in the CreateProcess won't work.
See http://www.codeguru.com/forum/showpo...5&postcount=10
Victor Nijegorodov
-
February 4th, 2011, 02:22 PM
#18
Re: Read Dos Out put
 Originally Posted by VictorN
I always thought that pipe is '|'. 
Yes, you could be right. Pipes, filters and redirection. It's a all a long time ago but I remember that '>' was one of them..!
"A problem well stated is a problem half solved.” - Charles F. Kettering
-
February 4th, 2011, 05:08 PM
#19
Re: Read Dos Out put
Code:
system("dir >> myfile.txt");
This would accomplish the goal, you could then use the text file to parse the results. Maybe not the best way though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|