New
#1
Directory Listing
How do I create my File names with the date at the front of the so that all the files are sorted mm-yy?
How do I create my File names with the date at the front of the so that all the files are sorted mm-yy?
For new files you'll have to do it when saving i suppose.
For existing files you could write a script that looks at the creationtime and converts it to a date.
Then you would rename the file by adding the creationtime in front of the filename.
With powershell this would look like:
Code:$files = gci c:\test | select CreationTime, Basename, Fullname, Extension foreach ( $x in $files) { $date = $null # retrieve date $d = $x.CreationTime.Day $m = $x.CreationTime.Month $y = $x.CreationTime.Year #convertdate to string $date = $d.ToString() + '_' + $m.ToString() + '_' + $y.ToString() #rename file with prefix date $newname = $date + '_' + $x.BaseName + '_' + $x.Extension Rename-Item -path $x.Fullname -NewName $newname }
I've used a format like this to sort by date.
2016-05-11-01-filename.doc Pretty simple: year-month-day-version #, a name I'll recognize. I've used version number when I wanted to save previous edits of a file.
It worked for me, hope it helps you.
Bulk Rename Utility, 32bit or 64bit, free or pay-for, will also do the trick; take time and care! A mistake can take lots of time to correct. If you're doing to do the date-in-front, I second the earlier posters' choice of yyyy-mm-dd format.
If you want the date before the file name just click on the title of the column and drag the column to the left.
Is there a rename utility that will count the date such as 60-12-01 , 60-19-01 , ect., that allows you to use your own "seed" date? And counts through and end date? Also doesn't use the computer date? John
Last edited by RBCC; 11 May 2016 at 22:34.