title: Re-naming a file name to include yesterday's date using command prompt
body: <p>I am trying to rename some log files to yesterday's date when the batch file creates a new file of same name every night. </p>
  
  <p>We can rename the file to today's date using the below cmd</p>
  
  <pre><code>ren SampleDTE.TXT SampleDTE-%date:~10,4%%date:~7,2%%date:~4,2%_%time:~0,2%%time:~3,2%.TXT
  </code></pre>
  
  <p>This results in file renamed to // SampleDTE-YYYYDDMM_hhmm.TXT</p>
  
  <pre><code>SampleDTE-20132712_1243.TXT 
  </code></pre>
  
  <p>I wanted to know how to re-name the file to yesterday's date. Something like</p>
  
  <pre><code> SampleDTE-20132612_1243.TXT
  </code></pre>
  
  <p>Thanks in advance</p>