Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  ProcessExists  

 Content of ProcessExists.vbs
MD5 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 ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a