title: Use Batch file to rename files and increment postfix
body: <p>I have a list of files. Every day I generate a new list of files. I need to keep this list of files previously generated. I would like to add and number to the end of yesterday's file and I would like to increment all previous files by 1 so that yesterday's file is always 0001. For example:</p>
  
  <p>Files generated yesterday are:</p>
  
  <pre><code>P.xls
  T.xls
  W.xls
  </code></pre>
  
  <p>I would like to run a batch file that names them:</p>
  
  <pre><code>P0001.xls
  T0001.xls
  W0001.xls
  </code></pre>
  
  <p>Ok. I can do that part. No big deal. The files are always named P, T, and W, so that part is easy. The harder part is to rename P0001.xls, T0001.xls, and W0001.xls every single day. I can make a batch file that starts like this:</p>
  
  <pre><code>rename P9998.xls P9999.xls
  </code></pre>
  
  <p>and work my way down to P0001.xls, but that is ridiculous. I don't want to type 10,000 lines for each file.</p>
  
  <p>Any help on this batch file would be greatly appreciated.</p>
  
  <p>Keith</p>