title: Rename files to include last modified
body: <p>I am attempting to rename a large batch of files to incorporate the dates in the &quot;Date Modified&quot; column from File Explorer into each filename in YYYYMMDD format. I was able to generate a report from the desired file folder of all the files inside using the following steps:</p>
  <ol>
  <li>Click on the Tips and Tricks folder</li>
  <li>Hold down the Shift key and right-click the Tips and Tricks  folder</li>
  <li>Click “Open Command Window Here”</li>
  <li>Type <code>dir&gt;filename.txt</code></li>
  <li>Click Enter</li>
  <li>Open the Tips and Tricks folder and look for a text file with the filename you created</li>
  </ol>
  <p>I then pulled the report into Excel as a delimited text file and manipulated the content so I now have the &quot;last modified&quot; date in one column and the filename in another:</p>
  <blockquote>
  <p><strong>Date Modified</strong> | <strong>File Name</strong></p>
  <p>1/9/2009  | ArcGIS_TT_Projections_Transformations.doc</p>
  <p>2/18/2014 | ArcGIS_TT_Re-Projection_WMAS.docx</p>
  <p>1/9/2009  | ArcGIS_TT_Set_Selectable_Layers.doc</p>
  <p>1/9/2009   | ArcGIS_TT_Spatial_Join.doc</p>
  <p>4/21/2010  | ArcGIS_TT_View_CLU_History_Layer.doc</p>
  </blockquote>
  <p>I have only had success using rename scripts like the following:</p>
  <pre><code>@echo off
  setlocal enableDelayedExpansion
  for %%F in (&quot;ArcGIS_TT_Projections_Transformations*.txt&quot;) do (
    set &quot;name=%%F&quot;
    ren &quot;!name!&quot; &quot;!name:ArcGIS_TT_Projections_Transformations=ArcGIS_TT_Projections_Transformations_20090109!&quot;
  )
  pause
  </code></pre>
  <p>But I am trying to avoid having to repeat that process for 61 files so the rename script I have does not meet my needs. Does anyone out there have a suggestion of a Windows CMD prompt or a simple .txt that I can use to pull in the date modified information into the filename more automatically?</p>
  <p>Thanks for your help!</p>