This tutorial talks about how to change file names to their date of creation. I have listed two different methods in the following tutorial to do the same. The first method uses a freeware while the other methods rely on CMD batch file. Both methods yield the same result. However, the second method has a limitation that you can’t undo the rename operation.
I am really note sure why would you need to rename files to their date of creation, but if you are on this tutorial, then you obviously have a good reason to do that. And this tutorial will tell you exactly how.
Let’s see, what are the different methods to change file names to their date of creation.
How to Change File Names to Their Date of Creation?
Method 1: Change File Names to their date of Creation Using a Software: Bulk Rename Utility
In the first method of changing file names to their date of creation, I will make use of a freeware called Bulk Rename Utility. It is a very powerful file renaming software. Using this freeware, you can easily change the file name, change case, remove a matching part, replace a matching part, append text, and many more. It has a bit complicated interface which is divided into various sections. Each section of its interface does a predefined task. And once you understand this, then it will be very easy to use Bulk Rename Utility to update files names in bulk to their date of creation. Apart from updating file names using predefined commands, you can also use regular expressions to rename files. And the best thing about this method is that you can undo the rename operation in case of any mistake.
It’s pretty easy to start with, just follow these steps:
Step 1: Download and install Bulk Rename Utility from this link. After that, open it up and you will see its interface similar to the following screenshot.
Step 2: We will use the Name (2) and Auto date (8) section of Bulk Rename Utility to change the file name to its date of creation. You can see them in the above screenshot. Configure them both by choosing the Remove option from the Name drop down of the Name section, as we want to remove the file name first and then put date of creation in its place. Now move to the Auto date section, and you will see various drop downs there:
- Mode: Here it has two options, Prefix, Suffix, and None. The Prefix option instructs the software that the date has to be put in the beginning of the filename. While in Suffix option the date will be added to the end of the file name.
- Type: Here you specify which date is to be put in the name of the file. You can choose creation date, modified date, accessed date, etc.
- Fmt: Using this drop down you can specify what format of the date you want to use to put in your file name. Here you will find many of them.
- Sep: This field accepts a separating character that will be inserted in between the file name and its extension.
- Seg: This field accepts a separating character that will be inserted in between Date, time, and year segment.
- Cent: This option when enabled, specifies whether the Year in the date will be of two digits or 4 digits.
Step 3: Now select the directory whose file names you want to change using the File Explorer give at the top left side of the software.
Step 4: Now, set all the drop downs and fields as are in the following screenshot:
So, in this way you can easily change file names to their date of creation using Bulk Rename Utility.
Do note that while renaming the files the software doesn’t include all the files in the output. So to include them all simply Press Ctrl+A keyboard shortcut, and then hit the Rename button.
Method 2: Change File Names to their date of Creation Using a CMD Batch Script.
In the above method, I have explained how to change file names to their date of creation using a software. In this method I will show you how you can do the same without using any third-party software. Although, the above method works fine, but there may be situations when you don’t want to use any 3rd party software. For that I have found this very simple and easy to execute Batch script.
The following script will change the file names to their date of creation. And the best part is that you can run it from any directory and you can also run it from the same directory in which all your files are. And you can do that by just adding an extra line in the batch script. To use the batch file in the directory itself, where your source files are, simply remove the second line (cd command).
Do note that you cannot undo the changes made by this script. So, run carefully. Be especially careful about the path of the folder, because if you give wrong path, it will rename all the files of that folder. Not a very good situation to be in.
To use this method, simply paste the following code in a notepad and save it as a .bat file extension. In my case I have used ilovefreesoftware.bat as the batch file name, but you can use any name. See the following screenshot.
Note: change the second line of the script below to the path of the folder that has files that you want to be renamed.
@echo off cd "C:\Users\ILFS\Desktop\ilovefreesoftware" for %%A in (*.*) do ( for /f "skip=7" %%B in ('dir /T:c "%%A"^|sort') do ( for /f "tokens=1-3 delims=/" %%C in ("%%B") do ren "%%A" "%%C%%~xA") )
Now, at his point you are done with the batch file. To run the file, simply double-click on it and you will see that it will rename all the files of the source directory to their date of creation.
So, in this way you can easily change file names to their date of creation using a simple batch script. However, here is one limitation in this method that you cannot undo the rename operation. So, be careful while using this method.
Also, do note that there could be a special situation that you have multiple files with the same date of creation. In that case, this script will rename only one of those files and will leave other files with the old name.
Closing Words:
In the above tutorial I have demonstrated how to change file names to their date of creation. And I have listed two methods in this and you can use any of them to do that same. The first method requires an additional software and there is an advantage that you can reverse the rename operation.