Using other than ascii keys in DOS window

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
liveitupmore
Junior Coder
Posts: 22
Joined: Wed Nov 16, 2005 3:58 am
Location: Gold Coast, Australia

Using other than ascii keys in DOS window

Post by liveitupmore » Wed Nov 16, 2005 4:01 am

Does anyone know how to send keys like PgUp, PgDn, down arrow, up arrow in a DOS window. I can send a carraige return using %CR%, but don't know how to use the others.

Alistair

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Nov 16, 2005 5:51 am

If I'm understanding you correctly, the "Press" function is what you're looking for.

Press Enter for a carriage return

Press Up
Press Down
Press Left
Press Right
for arrow keys

Press Page Up
Press Page Down


Hope this is helpful,
Dick

liveitupmore
Junior Coder
Posts: 22
Joined: Wed Nov 16, 2005 3:58 am
Location: Gold Coast, Australia

Post by liveitupmore » Wed Nov 16, 2005 9:22 pm

The Press function doesn't seem to work in a DOS window. Am I doing something wrong?

Many thanks for your suggestion.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Nov 16, 2005 10:09 pm

This works for me using Windows XP.

Paste the following into a new macro, make sure you remove any trailing spaces. Assign the macro a hotkey. Open a fresh DOS window. Make sure that it has focus ( that it is the foreground window) Then execute the script by using the hotkey (mine was set to CTRL + Shift + p)

Here is the macro:


Wait>1
Send>c:
Wait>0.5
Press Enter
Wait>0.5
Send>cd \
Wait>0.5
Press Enter
Wait>0.5
Send>dir
Wait>0.5
Press Enter
Wait>2
Press Up
Wait>1
Press Enter
Wait>2
Press Right
Wait>1
Press Right
Wait>1
Press Right
Wait>1
Press Enter


Hope this works for you.
Dick

liveitupmore
Junior Coder
Posts: 22
Joined: Wed Nov 16, 2005 3:58 am
Location: Gold Coast, Australia

Post by liveitupmore » Thu Nov 17, 2005 6:47 am

Unfortunately I am using Windows 98 which doesn't respond the same. The DOS application I'm using (a Point of Sale system) doesn't work on XP.

Any more suggestions please

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

Post by CyberCitizen » Thu Nov 17, 2005 11:07 pm

Use MS's Record Function, Do What You Require The Script To Do, Play The Script See If It Works, If It Does Then Review The Script For The Required Keys.
FIREFIGHTER

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