Help with vbscript and windows nt
-
Hi Guys, Well I'm totally stumped. I've got a bit of vbscript code that tries to find a particular process running on a machine (Windows NT). If the process exists I want the text ("I am running...") displayed. If it doesn't exist then I want the text ("I am not running") displayed. Just some background on the OS. Its Win NT 4 service pack 6 and i reinstalled WMI Core 1.5 On win xp, win 2k and win 2k3 the script below works fine. However on windows nt where this will reside on it fails giving me an error 80041001 which I belive is a "Call failed" error. Can anyone shed some light on why this would be happening on NT in particular? Thanks in advance <% Dim strComputer, strProcess strComputer = "." On Error Resume Next Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}! \\" _ & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process") For Each objProcess in colProcess do while objProcess.name = "Someprocess.exe" strProcess = objProcess.name 'objProcess.Name 'If objProcess.name = "Someprocess.exe" then Response.Write ("I am running...") 'Else 'End If Exit Do Loop Next If strProcess = "" then Response.Write ("I am NOT running") End If %>