home *** CD-ROM | disk | FTP | other *** search
- ' ***************************************************************
- ' * CheckNumOfProcesses.vbs *
- ' * By Vittorio Pavesi (www.vittorio.tk) *
- ' * *
- ' * Check number of active process and return details *
- ' ***************************************************************
-
- CheckProc(30)
-
- Sub CheckProc(MaxProcN)
- Set Proc1 = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_process")
- ProcN = 0
- for each Process in Proc1
- 'WScript.Echo Process.Name
- ProcN =ProcN +1
- Next
- if ProcN <= MaxProcN then
- WScript.Echo "OK"
- else
- WScript.Echo "Error"
- end if
- WScript.Echo ProcN & " processes active"
- End sub
-