title: How to get the output of "wmic process call create"
body: <p>I'm trying to get the output of <code>wmic process call create</code> so I can get the <code>ProcessId</code> of the newly created process. If I just run:</p>
  
  <pre><code>wmic process call create "notepad.exe a.txt","d:\"
  </code></pre>
  
  <p>It works just fine (it opens the file <code>a.txt</code> under folder <code>d:\</code> with <code>notepad</code>). Now, if I try:</p>
  
  <pre><code>for /f "usebackq delims==; tokens=1,2" %i in (`wmic process call create "notepad.exe a.txt","d:\"^|findstr ProcessId`) do @echo pid = %j
  </code></pre>
  
  <p>It doesn't, and shows me the error:</p>
  
  <blockquote>
    <p>Formato incorrecto.
    Sugerencia: &lt;lista_parámetros&gt; = &lt;parámetro&gt; [, &lt;lista_parámetros&gt;].</p>
  </blockquote>
  
  <p>I don't really know what's going on here, can anyone explain this to me or if this is possible at all?</p>
  
  <p><strong>NOTE:</strong> Other commands work fine. For instance, if I run: </p>
  
  <pre><code>for /f "usebackq" %i in (`wmic process where "executablepath like '%%notepad.exe'" get ProcessId /value^|findstr ProcessId`) do @echo OUTPUT: %i
  </code></pre>
  
  <p>It gives the expected output, which in this case is:</p>
  
  <blockquote>
    <p>OUTPUT: ProcessId=2084</p>
  </blockquote>
  
  <p>Thanks!</p>