Copying Text from Dos/Command Prompt in XP

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
FogartyM
Newbie
Posts: 3
Joined: Sat Jan 20, 2007 11:31 pm

Copying Text from Dos/Command Prompt in XP

Post by FogartyM » Sat Jan 20, 2007 11:39 pm

I am trying to copy text from a dos based program in XP. I have been trying the following code to test if it is possible:

Label>start
Setfocus>Command Prompt
GetWindowText>Command Prompt,Horizontal
Run Program>notepad.exe
WaitWindowOpen>Untitled - notepad
Send>Horizontal
Label>end

I have tried using the macro both when running the dos program and when I simply had the dos window open. It was not full screen and I have used macros to send key presses with the program before. Any help would be great.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Jan 21, 2007 12:05 am

It looks like you might be trying to copy the word "horizontal" from a DOS command window, and paste it into NotePad?

A few notes:

Label>start
Setfocus>Command Prompt
GetWindowText>Command Prompt,Horizontal
//This does not "get" the text. This is a mouse-intensive process. You need to click on the top left corner of the DOS window to get the drop down menu/Edit/Mark/use mouse to select text to copy/Enter (May need to position, resize the window first, then use relative positioning when you click on start position and drag/release position before pressing Enter).

Run Program>notepad.exe
WaitWindowOpen>Untitled - notepad
Send>Horizontal
//Need to set focus again. Before capturing/sending/mouse action.
Label>end
==============================

This may be a frustrating process to learn with because of the DOS Copy issues. What is the specific DOS program you will be working with? Can you be more specific about what you are going to be doing? There may be another way to do this.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

FogartyM
Newbie
Posts: 3
Joined: Sat Jan 20, 2007 11:31 pm

More informatyion

Post by FogartyM » Sun Jan 21, 2007 5:09 pm

Thank you that was helpful but I will tell you more so I can come up with the best solution.


I am using a dos program that reads from a data file and processes the information. I am automating the program so that it is not necessary to go through the program and press all of the buttons. The program is simple and only requires a few key presses. At one point in the program it gives 4 values : Horizontal, Vertical, and 2 Dimenions. I need to copy the value in Vertical and paste it into the Horizontal position. Each value corresponds to the numbers 1-4. EX: You would press 1 to change the Horizontal Value, 2 to change the Vertical Value, etc... I want to copy the Vertical Value and then Paste that number into the Horizontal Value. If you need more information please let me know. Thank you for the help.

Mike

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 22, 2007 4:57 am

What is the name and version of the DOS program.
Is it proprietary, or a standard commercial product?

When using the program manually, is there a way you can copy the value to the clipboard or sent the information out to a text file?

A screen shot may also be helpful for us.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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