VBScript sendkeys to automate legacy DOS app
Posted on 2007-07-20
We run an old clipper application through DOS. It's fast and easy to use and does almost everything we need it to do. The one problem I have is running the regular maintenance through the application. It has no scheduler or outside processes we can run on a schedule. I was trying to write a vbs that would send the keystrokes to the application, but it doesn't seem to work. I tried in both command.com and cmd.exe. It will open the DOS window and in cmd will actually launch the application. In command, it only sits at the default prompt. The below is me just trying to open the app, then exit. Any ideas on how to send the keys to these legacy apps in winXP?
Dim objShell, intWait, wsh
Set objShell = CreateObject("WScript.Shell")
Set wsh = CreateObject("Shell.Application")
intWait = 1000