WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sample code
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Test if Application Exists before Exit of Windows

Keywords: close apps  IntControl(12,0,0,0,0) IntControl(12,10,0,0,0)

Here's a script to check to see if an application exists, and if so, close it. If it doesn't exist, then loop until it does, and then close it.
name="File Manager"

While @true

  If WinExist(name)
     IntControl(12, 10, "close apps first",0,0) ;refuse to terminate WinBatch and Windows
     while WinExist(name)
	  delay(4)
     endwhile
else
     IntControl(12,0,0,0,0) ;Pop up message box giving user a chance to either cancel bat file or continue,
			    ;and Provide notification message when program terminated by user.

     while !WinExist(name)
	  delay(4)
     endwhile
  endif
endwhile

Article ID:   W13758
Filename:   Test if App Exists before Exit Windows.txt
File Created: 1999:04:15:16:56:10
Last Updated: 1999:04:15:16:56:10