Const EXE = "%ProgramFiles%\IrfanView\i_view32.exe" 'application which should get closed, in this case IrfanView

Set sh = CreateObject("WScript.Shell")
Set wnd = CreateObject("UltraMon.Window")
exeExp = sh.ExpandEnvironmentStrings(EXE)

For Each w In wnd.GetAppWindows(False)
	If StrComp(w.ProcessExe, exeExp, 1) = 0 Then
		w.Close
	End If
Next
