title: Remove unwanted spaces in wmic results through batch file
body: <p>Im working on a batch file in which I need to show the estimated charge remaining of the battery, I have achieved my goal but sadly I am not happy with the results due to excesive and unwanted spaces in the command result.</p>
  
  <p>Here's my code:</p>
  
  
  
  <pre class="lang-bat prettyprint-override"><code>:charge
  FOR /F "delims= skip=1" %%i IN ('WMIC PATH Win32_Battery Get EstimatedChargeRemaining') DO ( SET CHR=%%i
  GOTO results )
  
  :results
  ECHO "Battery Percentage: %CHR%"
  PAUSE
  GOTO menu
  </code></pre>
  
  <p>The result of the above command is: <code>"Battery Percentage: 100           "</code></p>
  
  <p>How do I get rid of those spaces at the end of the result?</p>
  
  <p>Thanks in advance and any kind of help is greatly appreciated.</p>