Accessing screen data in DOS session

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
smoffitt
Newbie
Posts: 2
Joined: Tue Apr 22, 2003 11:53 pm

Accessing screen data in DOS session

Post by smoffitt » Tue Apr 22, 2003 11:58 pm

Is there any way to access text on the screen if it's within a command (DOS) session? We have a DOS application that I need to keep going through a series of keystrokes to process data until there is no more data to process. I was thinking I have two basic options -- either loop until a field is empty, or go until I get an error message on the screen. Both methods require that I can read from the DOS window (either static text or data in an input field).

I tried using GetWindowText, but it doesn't recognize any text in the dos session. I also tried selecting the text and copying it to the clipboard, but it won't copy text from the dos session to the clipboard, so no luck there.

Help!

Mundekis
Newbie
Posts: 16
Joined: Fri Apr 18, 2003 10:15 pm

Post by Mundekis » Thu Apr 24, 2003 12:09 am

You could try this it should work if your using Windows NT.
I hope this gets you headed in the right direction.
SetFocus>Your Dos Window Name
Press ALT
Wait>0.02
Send> es
Wait>0.02
Release ALT
Wait>.02
Press Enter
SetFocus>Untitled - Notepad
Wait>.02
Press CTRL
Send>V
Release CTRL

Guest

Another solution (may not work for all)

Post by Guest » Thu Apr 24, 2003 3:40 pm

That method didn't work for my situation, but I suspect it has a lot to do with the particular application that you're working with, so I'm including another solution that did work for me, and so might be another option for others to try.

I just moved the mouse to the start of the text, doubleclicked to select the text and then pressed the right mouse button to copy it to the clipboard (!). (Not sure why clicking the right mouse button worked, but it did).

MouseMoveRel>500,130
LDblClick
RClick
GetClipBoard>txtField

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Apr 25, 2003 9:36 am

Hi,

That would be because you have Quick Edit mode selected in Edit Options under Properties for cmd.exe

Very useful.
MJT Net Support
[email protected]

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