Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking exe status

Status
Not open for further replies.

ghobbes98

Programmer
Feb 7, 2002
62
IE
I wanted an appliction to run periodically that goes and checks to see if an exe is still running.
If the exe is not running that I want to be alerted to the exe falling over.
Any suggestions of something that would return back true or false if given an exe name whether it was running or not
 
if you have windows 2000 or better then you can use the WMI :

i butchered this from an old vbscript:

Private Function findprocess(Proc As String) As Boolean
Dim WMI, Query
Dim cQuery As String

Set WMI = GetObject("winmgmts:")
cQuery = "select * from Win32_Process where name='" & Proc & "'"
Set Query = WMI.ExecQuery(cQuery)

findprocess = (Query.Count > 0)
End Function
 
You can use WMI on NT4, you just need to download the toolkit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top