Capture text from cmd window

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Capture text from cmd window

Post by rullbandspelare » Thu Apr 18, 2013 3:41 pm

Hi!
I am trying to capture the text in a cmd window running fullscreen on a XP machine.

I have tried :

Code: Select all

GetTextInit

GetWindowText>C:\WINDOWS\system32\cmd.exe,CMDText

GetControlText>C:\WINDOWS\system32\cmd.exe,ConsoleWindowClass,1,CMDText

GetControlText>C:\WINDOWS\system32\cmd.exe,ConsoleWindowClass,1,CMDText

GetTextInRect>0,0,200,400,CMDText
Non of theese work in fullscreen and only the last one works in windowed mode.

Any ideas?

Thanks!

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Re: Capture text from cmd window

Post by olllllliii » Thu Apr 18, 2013 4:33 pm

U can try this.

Code: Select all

GetTextInit
GetWindowTextEx>C:\Windows\system32\cmd.exe,strText
MDL>strText
Kind regards oli
Oliver Hilger Mannheim
alias Olllllliii

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Thu Apr 18, 2013 4:52 pm

Hi!

Thanks for Your input, but no. That is not working.

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Post by olllllliii » Thu Apr 18, 2013 5:58 pm

Is Macroscheduler running as user & cmd as superuser ( admin )..
u used Windows 7 64 bit , both running under user rights....

normally it must work ....maybe the rights...
Oliver Hilger Mannheim
alias Olllllliii

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Fri Apr 19, 2013 1:06 am

I never had much luck getting text from a DOS prompt. I always used to pipe the data out to a text file then read that file.

eg Run>CMD /c Ping Localhost > C:\temp\pingresults.txt

Using the text capture wizard, this worked for me.

Code: Select all

GetTextInit
GetWindowTextEx>Administrator: C:\Windows\system32\cmd.exe,result
MDL>%result%
FIREFIGHTER

rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

Post by rullbandspelare » Fri Apr 19, 2013 11:21 am

Thanks for Your input!

This works indeed on a DOS window on a XP machine. BUT, it does not work if You put the DOS window in fullscreen = pressing Alt + Enter
In this case it is an old program running in DOS , not a command line output.

Code: Select all

GetTextInit
GetWindowTextEx>C:\WINDOWS\system32\cmd.exe,result
MDL>%result%

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts