I have the following VBscript that kills a process sucessfully on my local PC, but when I try to run this script on our server it doesn't kill the busobj.exe process. Why would this be?
Thanks,
Stan
ServerName = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!//" & ServerName)
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'BUSOBJ.EXE'")
For Each Proc in colProcessList
If Proc.CreationDate <> "" Then
PDate = Left(Proc.CreationDate,14)
Days = DateDiff("d",DateSerial(Left(PDate,4),Mid(PDate,5,2),Mid(PDate,7,2)),Date)
Hrs = Hour(Now) - Mid(PDate,9,2)
Min = Minute(Now) - Mid(PDate,11,2)
Sec = Second(Now) - Mid(Pdate,13,2)
If Min > 5 Then
Proc.Terminate()
End If
End If
NEXT
Thanks,
Stan
ServerName = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!//" & ServerName)
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'BUSOBJ.EXE'")
For Each Proc in colProcessList
If Proc.CreationDate <> "" Then
PDate = Left(Proc.CreationDate,14)
Days = DateDiff("d",DateSerial(Left(PDate,4),Mid(PDate,5,2),Mid(PDate,7,2)),Date)
Hrs = Hour(Now) - Mid(PDate,9,2)
Min = Minute(Now) - Mid(PDate,11,2)
Sec = Second(Now) - Mid(Pdate,13,2)
If Min > 5 Then
Proc.Terminate()
End If
End If
NEXT