title: how to get PID from command line filtered by username and imagename
body: <p>I need to be able to get the PID from a running process (cmd.exe) using the command line.
  The problem is there are two cmd.exe running. One is under the username SYSTEM and one is compUser. Is there a way that I can grab the PID of the compUser cmd.exe?</p>
  
  <p>Edit: This needs further explanation.
  I'm doing this from a batch file. One of the calls that I'm making in my batch file starts a cmd.exe that never dies. So killing that cmd.exe would be simple:</p>
  
  <pre><code>taskkill /F /IM cmd.exe /FI "username eq compUser"
  </code></pre>
  
  <p>The problem is that the batch file that I'm in is being handled by another instance of cmd.exe under the username compUser. What I'm attempting to do is get the PID from the original cmd.exe before I start the second cmd.exe. That way I can just use the command:</p>
  
  <pre><code>taskkill /F /IM cmd.exe /FI "username eq compUser" /FI "PID neq [orignal task's PID]"
  </code></pre>