Sending Keypresses To DOS
|
Top Previous Next |
In most cases sending keypresses to a Command Prompt (DOS) window will function exactly the same as sending keypresses to any other windows application.
There are a few things to watch out for:
DOS treats the % character as a special character for defining variables, whereas System Scheduler uses the % character as the ALT key modifier. When you actually want to send the % character enclose it in curly braces like this:
Sendkeys=echo {%}path{%}
You cannot use the special key token {CODE=xxx} with DOS windows as they do not correctly respond to the ALT + NUMERIC KEYPAD codes when sent programatically. For DOS windows there is an additional token {ASCII=xxx} which does a very similar thing but has access to a more limited character set.
The DOS window can have its own keyboard layout and code page loaded, so characters that appear correctly in a windows application may not appear the same in DOS. For example, you can type KEYB UK in a DOS window to get the UK keyboard layout or KEYB US to get the US one, some keys are different with each keyboard. To get round any conflict with characters you can try switching to a different keyboard layout before sending keypresses like this:
Sendkeys=KEYB UK{ENTER}{WAIT=1000}Here is a back slash {ASCII=92} or Sendkeys=KEYB US{ENTER}{WAIT=1000}Here is a back slash {ASCII=92}
In these two examples you will probably find that one keyboard layout will correctly produce a back slash, the other will produce a hash symbol.
|