Auto click error message

April 8, 2012 at 00:17:10
Specs: Windows xp
I have an application that runs daily every morning. On occasions an error message comes up and halts the program until the 'OK' button is pressed. The title of the error meesage is 'Oh No' and comes up in the application tab of taskmanager as 'Oh No'. Is there any code eg vbscript that I can run in the back ground which will automatically simulate the mouse click to 'OK' this error message and let the program continue. Can it look at the applications and when it sees 'Oh No' then perform the click. Thanks in anticapation.

See More: Auto click error message

Report •

June 16, 2012 at 22:12:04
Yes, vbscript can do appactivate and sendkeys, something like this:
set W = WScript.CreateObject("WScript.Shell")
on error resume next
do while x=1
z=W.AppActivate("Oh No")
if z=-1 then
wscript.echo "sending"
wscript.sleep 2000
exit do
wscript.echo "done."

see or google "script.chm" for vbscript details. I'm not proficient in it... Make sure
the window's title is "oh no", that's the key
for appactivate to work. This script should loop until such window-title appears, then clear it and exit.

Report •

June 17, 2012 at 02:16:32
Thanks nbrane. I ended up using a program called AutoIT which works ok. The only problem with it is when I remotely access the PC, I have to make sure I don't leave the log in window active.
I did think I took this question off but there you go.
I will play about with your script to see if I can overcome the log in problem.
Thanks anyway for the time to post.

Report •

Related Solutions

Ask Question