How can I check if an application is running in a VBScript?
In this case, I'm trying to see if Internet Explorer is open.

Thanks,
Russ

Re: Check for running application? by Miyahn

Miyahn
Thu May 11 16:28:20 CDT 2006

"Russ Ringer" wrote in message news:cg8762hka0dettr156l4q3ne8fni71l161@4ax.com
> How can I check if an application is running in a VBScript?
> In this case, I'm trying to see if Internet Explorer is open.

Try this.

' CheckIE.vbs
Dim aWin
With CreateObject("Shell.Application")
For Each aWin In .Windows
If TypeName(aWin.document) = "HTMLDocument" Then
WScript.Echo "IE is running": Exit For
End If
Next
End With

--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP for Microsoft Office - Excel(Jan 2006 - Dec 2006)
https://mvp.support.microsoft.com/profile=e971f039-a892-426c-9544-83d372c269b4


Re: Check for running application? by mayayana

mayayana
Thu May 11 16:41:14 CDT 2006

For most things you'd need 3rd-party software.
(Or maybe WMI?) But for IE you can use ShellApp:

Set ShellApp = CreateObject("Shell.Application")
Set Wins = ShellApp.Windows

Wins will now be a collection of all open Explorer
or IExplore windows. They're all IE objects, but you
can tell what's what from the LocationURL value.
For folders it will be a valid folder path (though formatted
web-style), while an IE window will have a file path or
URL.

> How can I check if an application is running in a VBScript?
> In this case, I'm trying to see if Internet Explorer is open.
>
> Thanks,
> Russ