Checking for running processes 
Author Message
 Checking for running processes

Hi, i'd like to use VBScript to check whether a process is running, and if
not, spawn that process. Now the spawning of the process is trivial, but
does anyone know a way to check if said process is running??

Thanks
salukibob



Wed, 27 Oct 2004 04:24:22 GMT  
 Checking for running processes
Function IsExecuting(sProc)
 set list = getobject("winmgmts:").execquery(_
  "select * from win32_process where name='" & sProc & "'")
 If list.count > 0 Then IsExecuting = True
End Function

example use:

If Not IsExecuting("notepad.exe") Then
' do it
End If


Quote:
> Hi, i'd like to use vbscript to check whether a process is running, and if
> not, spawn that process. Now the spawning of the process is trivial, but
> does anyone know a way to check if said process is running??

> Thanks
> salukibob



Wed, 27 Oct 2004 05:03:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Check for running process...

2. check running processes

3. Checking if a process is running under NT4 - Using WSH

4. Checking if a process is running under NT4 - Using WSH

5. Checking for a Running Process

6. Real-time or background running of a process, a la spell check

7. How to check to see if process Running

8. Checking File Create Date and Terminating Running Process

9. How do you check if a process is still running a job

10. Check to see if another application or process is running

11. Checking (remote) if a process is running

12. Process ID of a running process

 

 
Powered by phpBB® Forum Software