title: How to convert a windows batch file into a signle line "cmd /c" command?
body: <p>I have the batch file below and wish to convert it to a single line <strong>cmd /c</strong> command.</p>
  
  <pre><code>@ECHO OFF
  SETLOCAL
  FOR /F "TOKENS=2 DELIMS=:." %%I IN ('chcp') DO SET _codepage_=%%I
  SET _codepage_=Cp%_codepage_: =%
  ECHO %_codepage_%
  ENDLOCAL
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>cmd /c FOR /F "TOKENS=2 DELIMS=:." %I IN ('chcp') DO @SET _codepage_=%I &amp;&amp; @SET _codepage_=Cp%_codepage_: =% &amp;&amp; @ECHO %_codepage_%
  </code></pre>
  
  <p>also tried:</p>
  
  <pre><code>cmd /v:on /c FOR /F "TOKENS=2 DELIMS=:." %I IN ('chcp') DO @SET _codepage_=%I &amp;&amp; @SET _codepage_=Cp%_codepage_: =% &amp;&amp; @ECHO !_codepage_!
  </code></pre>
  
  <p>but neither approach works! Can anyone help me out here?</p>