Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: DOS wait runwait FileExist delay
His first script should handle all of his keystrokes up to the point that the reports are run. Then a second script can be written to check for the program to go away before it continues.
;;First WBT file ;;Starts and runs the second script and does all keystrokes up to the report generation. Run("2ndwbt.wbt", "") SendKeys... ; send the relevant keys here SendKeys... ; same as above SendKeys... ; same as above ;; Reports are being generated. The reports finish, and the DOS application ;; closes because the DOS PIF is set to Close On Exit exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;2ndwbt.wbt ;;Checks for the existence of the DOS app. When it closes, the script continues ;;with the rest of the code he would like to have executed. While WinExist("DOS Program") timedelay(2) endwhile ;;Dos program is done, has closed, and script continues. Sendkeys ;;etc. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If he needs to send a keystroke to close the program, then he needs to pause while processing continues. If certain reports are generated when the program has finished, then check for the existence of these reports:
While ! FileExist("report1.xxx") timedelay(2) endwhile
To check for more than one file, you must have separate checks:
While ! FileExist("report1.xxx") && FileExist("report2.xxx") && FileExist("report3.xxx") timedelay(2) endwhileTo read the additional information on creating delays, search for "wait" elsewhere on these Web pages.
Article ID: W12908
Filename: Waiting for DOS apps to finish.txt
File Created: 1999:04:15:16:50:28
Last Updated: 1999:04:15:16:50:28