the following script does the job (sends ESC to the app and causes it to exit) IF i dont focus on a different window between the moment i run the script and the app is finished starting. if i do select another window between running the script and the app done loading, i can see the title bar for the foremost window (login) on that app blinking every 1 second, but it doesnt not close the app and it loops there until i manually focus back on the app.
when the app starts it opens up a login box named "login". the app is named "store operations manager". it doesnt matter if i bring the focus to the main window or the child window, because it defaults to the login window and as soon as i manually bring focus to it the ESC gets sent and the app exits. the same problem occurs when the script is run as a scheduled task (when there is nobody manually switching focus as i am the only one who logins to this win2003 SBS machine)
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run """C:\Program Files\Microsoft Retail Management System\Store Operations\SOMANAGER.exe"""
Do Until Success = True
Success = objShell.AppActivate("Store Operations Manager")
what is the problem here?
Set objShell = nothing