Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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