-
February 4th, 2011, 07:04 AM
#1
Read Dos Out put
Hi All
Can i read Dos command out values in file or Buffer?
For example if i run dir command in dos then it show file and directory name.Now i want to store these file and directory in file or Buffer.
is it possible then guide me..
-
February 4th, 2011, 07:25 AM
#2
Re: Read Dos Out put
1. I gave some links that could help in your previous thread about running .bat (.cmd) files.
2. To get the result of "dir command" you don't need starting ms dos dir. There are Windows APIs (FindFirstFile/FindNextFile/FindClose) and their MFC wrapper (CFileFind class) that you should use.
Victor Nijegorodov
-
February 4th, 2011, 07:30 AM
#3
Re: Read Dos Out put
Thanks for reply
Yes your link help me to solve last problem.
sir dir command just a example, command may be Copy con,Makedir etc
Sir is it possible to read values from command prompt?
Please guide me
-
February 4th, 2011, 07:34 AM
#4
Re: Read Dos Out put
MS Dos copy and mkdir have corresponding Win32 "analogs": CopyFile and CreateDirectory.
Victor Nijegorodov
-
February 4th, 2011, 07:37 AM
#5
Re: Read Dos Out put
Originally Posted by VictorN
MS Dos copy and mkdir have corresponding Win32 "analogs": CopyFile and CreateDirectory.
Sir i know these thing also Win32 "analogs but my question is
Is it possible or not?
-
February 4th, 2011, 07:40 AM
#6
Re: Read Dos Out put
Originally Posted by Msm
Is it possible or not?
Yes, it is possible. See the p.1 in the post#2.
Victor Nijegorodov
-
February 4th, 2011, 07:45 AM
#7
Re: Read Dos Out put
What will you read by dos command copy or delete ?
-
February 4th, 2011, 07:48 AM
#8
Re: Read Dos Out put
Originally Posted by VictorN
Yes, it is possible. See the p.1 in the post#2.
Sir can you give me more details.
-
February 4th, 2011, 07:49 AM
#9
Re: Read Dos Out put
Originally Posted by hypheni
What will you read by dos command copy or delete ?
Sorry, I haven't understood what you meant!
if "what Win32 APIs could be used for copy and delete" then:
CopyFile
DeleteFile
Victor Nijegorodov
-
February 4th, 2011, 07:53 AM
#10
Re: Read Dos Out put
Originally Posted by Msm
Sir can you give me more details.
Again: I gave some links that could help in your previous thread about running .bat (.cmd) filesPlease, open your previous thread, search for my post with the links, open these links and read (they all are MSDN and Support articles)
Victor Nijegorodov
-
February 4th, 2011, 07:54 AM
#11
Re: Read Dos Out put
Originally Posted by VictorN
Sorry, I haven't understood what you meant!
if "what Win32 APIs could be used for copy and delete" then:
CopyFile
DeleteFile
ok sorry
But this is not solution and not and of my problem..
-
February 4th, 2011, 07:54 AM
#12
Re: Read Dos Out put
No, Msm posted Can i read Dos command out values in file or Buffer?
So what will he store in file or buffer by copy or delete command ?.
-
February 4th, 2011, 08:00 AM
#13
Re: Read Dos Out put
Originally Posted by hypheni
No, Msm posted Can i read Dos command out values in file or Buffer?
See the post#2 in this thread.
Originally Posted by hypheni
So what will he store in file or buffer by copy or delete command ?.
And what kind of information is supposed to be stored "in file or buffer by copy or delete command"?
And what for?
Victor Nijegorodov
-
February 4th, 2011, 08:40 AM
#14
Re: Read Dos Out put
Oh yes I didn't check that he asked for values to be read from console. I though he asked for output screen to be saved in file stream.
-
February 4th, 2011, 11:39 AM
#15
Re: Read Dos Out put
You can of course redirect the output of any console command to a file which can then be read. However, I'm unclear as to why one would do such a thing. Perhaps if you clarified your high-level objective rather than focusing on your present strategy?
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
|