How to send a keystroke to a DOS application
Win 95/98 solution: Copy the desired keystroke to the clipboard as a text. SendKeys "{ALT} EP" To the DOS window. This works like you click on the Control Menu of the DOS window then select the Edit/Paste command.
Example:
Dim proc, number
Run "c:\bin\myprog.exe", "c:\bin", proc
// copy to the clipboard my name followed by the TAB key followed by my password followed
by the ENTER key.
ClipboardSet "myname\tmypassword\r"
// simulate DOS Edit/Paste command
SendKeys "{ALT} EP"
Common solution (Win 95/98/NT/2000): Redirect
DOS based application input to a file. Use Windows Notepad to create a text file
containing the keystroke that you want send just like you type it in your DOS application.
Perhaps, this file name is INPUT.TXT. Run your program using the following command:
Example:
Dim proc, number
Run "c:\bin\myprog.exe < c:\bin\input.txt", "c:\bin", proc
Note: same techniques can be used in the command line parameter of jobs of the Program type.