home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Health Monitor 2.1 / HealthMonitor.msi / _A9A458837CEAFF9D55B2EAE342FFA8DF / _1DF08092F9144845A8C603DEA10D48A8 < prev    next >
Encoding:
Text File  |  2005-01-03  |  733 b   |  24 lines

  1. ' ***************************************************************
  2. ' * CheckNumOfProcesses.vbs                           *
  3. ' * By Vittorio Pavesi (www.vittorio.tk)              *
  4. ' *                                * 
  5. ' * Check number of active process and return details           *
  6. ' ***************************************************************
  7.  
  8. CheckProc(30)
  9.  
  10. Sub CheckProc(MaxProcN)
  11.     Set Proc1 = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_process")
  12.     ProcN = 0
  13.     for each Process in Proc1
  14.        'WScript.Echo Process.Name
  15.        ProcN =ProcN +1
  16.     Next
  17.     if ProcN <= MaxProcN then
  18.         WScript.Echo "OK" 
  19.     else
  20.         WScript.Echo "Error" 
  21.     end if
  22.     WScript.Echo ProcN & " processes active"
  23. End sub
  24.