VBScript to detect an open messagebox and close it

Has anyone found a way to detect for and close an open messagebox from another program? I am trying to automate the uninstall of a program. At the end of the uninstall the program tells the user that the computer must be rebooted and makes the user click "ok".

The uninstall command is part of a script I wrote. I would like the messagebox to close automaticly so that it can continue on with with rest of the script without any user interaction.

I was thinking this might be possible with VBScirpt.. if anyone could help I would greatly appreciate it.

i'm facing the same issue with the uninstall of a peice of software i'm trying to automate. the uninstall is completely silently, then at the end it prompts the user to restart--unacceptable.

just off the top of my head a pretty crude way of handling it could be writing an autoit script that uses the winwaitactive fuction, compile it into an exe and run it pre uninstall. however with this method the dialog box would still be briefly visible and therefore intrusive to the user.

something that might work (i'd need to investigate it further as it's an idea that's just popped into my head), would be to write a vbs that after a specified timeout kills the uninstall process. used in conjuction with microsoft sms, which has the ability to suppress program notifications and run program windows hidden, you might just able to deploy an sms package that runs the vbs first, runs the uninstall which completes just before the vbs timeout occurs and kills the process.

of course the latter suggestion depends on you being lucky enough to be using ms sms at your site. i'll play with this in the next couple of days and post my results.

Ok, I don't think that the original poster wants a way to produce a timed message box. The subject and content of the post seems to suggest that an install is being kicked off and the install presents the message box. A way to close it safely is what is desired, I beleive.

My guess is that it could be done with VBScript and below is a link to the SendKeys method.