title: Is there something to double output a % character?
body: <p>Is there something in a BATCH file that would double a % character?</p>
  
  <p>The test.txt INPUT file contains the following </p>
  
  <pre><code>Hello World
  
  The filename is : filename with spaces and 50% percentages signs.txt
  The %~nf removes extenstions
  Is there something to double a % charactor?
  As I would like 50% to be outputed as 50%% 
  because the output of this batch is to create input for another batch.
  </code></pre>
  
  <p>The batch file.</p>
  
  <pre><code>@echo off
  setlocal EnableDelayedExpansion
  
  echo. &gt; test2.txt
  
  for /f "tokens=*" %%a in ('type test.txt') do (
      if "%%a"=="Update=Yes" (
          @echo Update=No &gt;&gt; test2.txt
      ) else if "%%a"=="Update=No" (
          @echo Update=Yes &gt;&gt; test2.txt
      ) else if "%%a"=="" (
          rem Questions TWO
          rem print a blank line doesn't work
          @echo. &gt;&gt; test2.txt
      ) else (
          set tmpvar=%%a
          set str=!tmpvar:%%=%%%%!
          echo !str!  &gt;&gt; test2.txt
      )
  )
  
  start test2.txt
  </code></pre>
  
  <p>The test2.txt output is (Note No Blank Line under Hello World)</p>
  
  <pre><code>Hello World  
  The filename is : filename with spaces and 50%% percentages signs.txt  
  The %%~nf removes extenstions  
  Is there something to double a %% charactor?  
  As I would like 50%% to be outputed as 50%%%%   
  because the output of this batch is to create input for another batch.  
  </code></pre>
  
  <p>Problem Two: How do I check if %%a is an empty line?   </p>
  
  <p>This does work but would require 400 lines; is there a way to do it using a For LOOP?</p>
  
  <pre><code>@echo off   
  
  set STR2=ON%%E
  
  echo This is STR2 %STR2%
  
  IF "%STR2:~0,1%"=="%%" (set STR3=%STR3%%%%%) else  set STR3=%STR3%%STR2:~0,1%
  
  IF "%STR2:~1,1%"=="%%" (set STR3=%STR3%%%%%) else  set STR3=%STR3%%STR2:~1,1%
  
  IF "%STR2:~2,1%"=="%%" (set STR3=%STR3%%%%%) else  set STR3=%STR3%%STR2:~2,1%
  
  IF "%STR2:~3,1%"=="%%" (set STR3=%STR3%%%%%) else  set STR3=%STR3%%STR2:~3,1%
  
  echo This is STR3 %STR3%
  
  pause
  </code></pre>