| View previous topic :: View next topic |
| Author |
Message |
Paula-QT Guest
|
Posted: Fri Nov 30, 2007 10:01 pm Post subject: DOS Data, can it be captured? |
|
|
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?
Best wishes, Paula |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Fri Nov 30, 2007 10:28 pm Post subject: |
|
|
| 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.
|
Posted: Sat Dec 01, 2007 1:10 am Post subject: |
|
|
| 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 |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1033 Location: switzerland
|
Posted: Sat Dec 01, 2007 9:27 am Post subject: |
|
|
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 |
|
 |
Paula-QT
Joined: 30 Nov 2007 Posts: 4
|
Posted: Sat Dec 01, 2007 3:49 pm Post subject: |
|
|
Purrfect BOBO Thank you so much . Have wonderful day! )
 |
|
| Back to top |
|
 |
ProsperousOne
Joined: 19 Sep 2005 Posts: 96
|
|
| Back to top |
|
 |
Paula-QT
Joined: 30 Nov 2007 Posts: 4
|
Posted: Tue Apr 01, 2008 7:24 pm Post subject: |
|
|
That is very useful! Thank you -- I think that is very ingenious how it works.  |
|
| Back to top |
|
 |
Deller
Joined: 21 Nov 2007 Posts: 202 Location: 0x01101110
|
Posted: Wed Apr 02, 2008 12:32 am Post subject: |
|
|
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 |
|
 |
|