tasklist to filter by multiple PIDs
<p>I'm using <a href="https://technet.microsoft.com/en-us/library/bb491010.aspx" rel="noreferrer"><code>tasklist</code></a> command.</p>

<p>I'm trying to use the <code>/fi</code> option to filter multiple PIDs.</p>

<h3>Attempt</h3>

<p><code>tasklist.exe /v /fi "PID eq 3248" /fi "PID eq 9488"</code></p>

<h3>Result</h3>

<p><code>INFO: No tasks are running which match the specified criteria.</code></p>

<p>This <strong>doesn't work</strong>. I can only assume the filters are evaluated internally using logical-and and obviously would never be true.</p>

<h3>Question</h3>

<p>How to filter by multiple PIDs?</p>

<h3>Ugly alternative 1</h3>

<p>If I run it separately, the result are OK and I can set the process information. However, </p>

<ul>
<li><code>tasklist.exe /v /fi "PID eq 3248"</code></li>
<li><code>tasklist.exe /v /fi "PID eq 9488"</code></li>
</ul>

<p>I'd like to refrain activating two separate commands. </p>

<h3>Ugly alternative 2</h3>

<p>use <code>find</code></p>

<pre><code>tasklist.exe /v  | find /i "9488"
</code></pre>

<p>Which brings the questions:</p>

<ol>
<li>How to I find multiple PIDs?</li>
<li>How to make sure the found strings are really the PID and NOT anything else.</li>
</ol>