title: Call WMIC commands in c++ code
body: <p>I am trying to re-write a logic that i had written in batch script into a c++ code and a DLL consequently.</p>
  
  <p>In my batch script i was checking for command line arguments of all java processes using WMIC. Here is the script - </p>
  
  <pre><code>FOR /F "tokens=*" %%A IN ('2^&gt;nul wmic process where^(name^="java.exe"^) get commandline ^| Findstr "XYZ"') DO SET Var=%%A 
  IF DEFINED Var  (
  cscript MessageBox.vbs "Message IN POP-UP."  
  GOTO :EOF
  )
  FOR /F "tokens=*" %%A IN ('2^&gt;nul wmic process where^(name^="javaw.exe"^) get commandline ^| Findstr "XYZ"') DO SET Var=%%A 
  IF DEFINED Var (
  cscript MessageBox.vbs "Message IN POP-UP."
  GOTO :EOF
  )
  </code></pre>
  
  <p>I want to re-use the same WMIC logic but now in a c++ code. Basically i want to avoid using vb scipt for the pop-up and i will call the "<strong>Message IN POP-UP</strong>" using some c++ commands.</p>
  
  <p>Any starting points?? I could use <code>system()</code> call but then how would i do the checks like the one's i have written in the IF condition inside the batch script.</p>