title: 'C:\wmic' is not recognized as an internal or external command, operable program or batch file
body: <p>I want to display in a browser the load percentage of a cpu trough php.
  This is the code I am using:</p>
  
  <pre><code>$command ="C:\\wmic cpu get loadpercentage"; 
  echo shell_exec("$command 2&gt;&amp;1 ; echo $?" );
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>'C:\wmic' is not recognized as an internal or external command, operable program or batch file.
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>Update - 1</p>
  
  <p>Change the code to allow spaces between words:
  <code>$command ="C:\\wmic^ cpu^ get^ loadpercentage";</code></p>
  
  <pre><code>'C:\wmic cpu get loadpercentage' is not recognized as an internal or external command, operable program or batch file.
  </code></pre>
  
  <p>Now the entire line of code is being read, not only <strong>'C:\wmic'</strong></p>