Is there a batch file command that closes a dialog box?
January 27, 2008 6:14 PM
Subscribe
For windows batch files, is there a way to automatically close dialog boxes that open as a result of a windows program producing an error?
I'm struggling trying to write a batch file for windows 2000 which does a variety of things on an hourly basis, one of which is to start a windows program to run.
That program goes out on the internet and makes some checks, and the batch file works fine for that. The problem is when the computer loses an internet connection for some reason, the program cannot complete it's internet check and produces a single dialog indicating it couldn't connect, with one "OK" button on it. At that point the batch file hangs, because I have other events in the batch file which must occur, and they can't complete because I had to use the start and wait switch like this:
Start /wait "" "windows program.exe" /run
which forces the batch file to wait until the window program finishes execution, and only then continues to the next line of the batch file. If I can just get the batch file to automatically close the error dialog, then the batch file can proceed normally as I want.
I'm fairly sure I'll need some sort of IF THEN statement to get this to work, but this is my first time trying to write a somewhat complicated batch file, and I'm not sure about how to integrate an IF THEN statement with some command to close that error dialog if it appears.
Anybody have any experience in batch files and can lend me some ideas?
Thanks.
posted by jldindc to computers & internet (5 comments total)
1 user marked this as a favorite
posted by aubilenon at 6:17 PM on January 27, 2008