AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DOS Data, can it be captured?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Paula-QT
Guest





PostPosted: Fri Nov 30, 2007 10:01 pm    Post subject: DOS Data, can it be captured? Reply with quote

Hello! I have this core little DOS program, that generates within the DOS window a bunch of statistics.

So, from DOS Window I have

------------------------------------------------------------------

C:\> MYDATADOS.EXE

Output 01012982A
Output 01212982B
Output 01312982C
Output 01412982D
Output 01512982E
Output 01612982F
Output 01712982G
Output 01812982H
Output 01912982I
Output 02012982J
Output 02112982K
Output 02212982L
Output 02312982M
Output 02412982N
Output 02512982O

C:\>

------------------------------------------------------------------

I am really hoping AHK provides some way for me to get access to this output information, somehow? It's generally 30-40 lines of statistics. Is there any way to get to this content externally from the .EXE, ... like anyway to 'scrape' it to a .TXT file or some other way I have not imagined? Any experts know? Smile

Best wishes, Paula
Back to top
BoBoĻ
Guest





PostPosted: Fri Nov 30, 2007 10:28 pm    Post subject: Reply with quote

Code:
RunWait, %comspec% /c MyDataDOS.exe > MyOutput.txt
FileRead, Content, MyOutput.txt
StringReplace, Content, Content, Output,, All
MsgBox, %Content%
Back to top
Cyber-Plague



Joined: 30 Nov 2007
Posts: 6
Location: In your serverz.

PostPosted: Sat Dec 01, 2007 1:10 am    Post subject: Reply with quote

BoBoĻ wrote:
Code:
RunWait, %comspec% /c MyDataDOS.exe > MyOutput.txt
FileRead, Content, MyOutput.txt
StringReplace, Content, Content, Output,, All
MsgBox, %Content%


Good job.
I was going to tell him how to extract data from CMD, so he could figure it out.
_________________
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1033
Location: switzerland

PostPosted: Sat Dec 01, 2007 9:27 am    Post subject: Reply with quote

remarks,
see DOS Window for a short time, to make it hidden or see always:
Code:
RunWait, %comspec% /c MyDataDOS.exe > MyOutput.txt,,hide  ;writes also to MyOutput.txt  , see nothing from DOS
RunWait, %comspec% /k MyDataDOS.exe      ;see always DOS
Back to top
View user's profile Send private message
Paula-QT



Joined: 30 Nov 2007
Posts: 4

PostPosted: Sat Dec 01, 2007 3:49 pm    Post subject: Reply with quote

Purrfect BOBO Smile Thank you so much . Have wonderful day! Smile)
Exclamation
Back to top
View user's profile Send private message
ProsperousOne



Joined: 19 Sep 2005
Posts: 96

PostPosted: Tue Apr 01, 2008 3:41 pm    Post subject: Reply with quote

Just found a nifty free MS program that copies Dos windows to the clipboard:

http://www.labnol.org/software/tutorials/copy-dos-command-line-output-clipboard-clip-exe/2506/
Back to top
View user's profile Send private message
Paula-QT



Joined: 30 Nov 2007
Posts: 4

PostPosted: Tue Apr 01, 2008 7:24 pm    Post subject: Reply with quote

That is very useful! Thank you -- I think that is very ingenious how it works. Razz
Back to top
View user's profile Send private message
Deller



Joined: 21 Nov 2007
Posts: 202
Location: 0x01101110

PostPosted: Wed Apr 02, 2008 12:32 am    Post subject: Reply with quote

The easiest way is this

C:\>doscommand subcommands>output.txt
or
C:\>MYDOSDATA>output.txt
and it will make output.txt with the output in it
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group