Loading |
VBScript |
JavaScript |
Powershell |
Search Options: ProcessExistsContent of ProcessExists.vbsMD5 Hash: BE81104F201DAF28B3C1A7BAEECF8F9D |
||
'#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#'
'/| |\\\\\\\\' '//| |\\\\\\\' '///| |\\\\\\' '////| Version 1.0.0 |\\\\\' '/////| Author: Boris TOll |\\\\' '//////| Last Update: 31.01.2008 |\\\' '///////| |\\' '////////| |\' '#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#*~#' Do while ProcessExists("notepad.exe") msgbox "Process is running" Loop ' -------------------------------------------- Private Function ProcessExists(strProcessName) Dim strComputer : strComputer = "." Dim oWMIService : Set oWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Dim colProcessList : Set colProcessList = oWMIService.ExecQuery("Select * from Win32_Process Where Name = " & Chr(34) & strProcessName & Chr(34)) Dim iProcessTrue : iProcessTrue = 0 For Each objProcess in colProcessList iProcessTrue = 1 Exit For Next Set oWMIService = Nothing Set colProcessList = Nothing If iProcessTrue = 1 then ProcessExists = true Else ProcessExists = false End if End Function | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |