title: VBscript check for running process on multiple computers
body: <p>Below is a script I have been trying to put together to check if a process is running on a list of remote computers. It works, in that it reports that the process is running on the remote machine, but if it is not running, I get no indication and it just skips over that machine. All of my attempts to display an alternate message if the process is NOT running have failed. Is there a way to say if PROCESS.exe is not found, display: </p>
  
  <p>"PROCESS NOT running on " &amp; ComputerName</p>
  
  <p>and then continue to loop through all of the machines?
  Thanks for the help.</p>
  
  <pre><code>Set fso = CreateObject("Scripting.FileSystemObject")
  Set listFile = fso.OpenTextFile("C:\list.txt")
  
  Do While Not listFile.AtEndOfStream
  ComputerName =  listFile.ReadLine()
  Set Service = GetObject("winmgmts:\\" &amp; ComputerName &amp;"")
      for each Process in Service.InstancesOf ("Win32_Process")
          If Process.Name = "PROCESS.exe" then
              wscript.echo "PROCESS running on " &amp; ComputerName
          End If
      Next
  Loop
  </code></pre>