title: Qt Creator: How to run a windows batch file and get result
body: <p>I currently have this batch file:</p>
  
  <pre><code>@echo off
  
  setlocal enabledelayedexpansion
  
  set Times=0
  
  for /f "skip=1" %%p in ('wmic cpu get loadpercentage') do (
  
  set Cpusage!Times!=%%p
  
  set /A Times=!Times! + 1
  
  )
  
  echo %Cpusage0%
  </code></pre>
  
  <p>And I would like to run it in a standard C++ Qt windows application and store the percentage in a variable. I can see you can run batch files using <code>QProcess</code>, but I'm not sure how to get the result.</p>
  
  <p>Thanks in advance for any help.</p>