Do you need to rename multiple files at once in Windows? Doing this manually can be tricky, but Windows supports scripts that you can run to automate the renaming process, saving you tons of time.
As an example, consider a case like the image above, where you have a folder with hundreds of images, each named â€œCopyâ€ and then a word or two, like â€œBlack Tea Copyâ€ .jpg.
Instead of manually renaming each file to remove the “Copy” or to replace those words with something else, you can run a script that does the renaming for you.
Software programs and cameras often add a specific set of symbols to the exported files, so this script is useful in such circumstances.
How the rename script works
A script is essentially an elaborate set of commands that tell the computer exactly what to do. Here is the search and replace script we are dealing with:
Install objFso = CreateObject (“Scripting.FileSystemObject”)
Set folder = objFSO.GetFolder (“ENTER PATH HERE”)
For each file in the Files folder
sNewFile = File.Name
sNewFile = Replace (sNewFile, “ORIGINAL”, “REPLACE”)
if (sNewFile File.Name) then
File.Move (File. ParentFolder + â€â€ + sNewFile)
A text editor is required to use this script. Windows’ built-in notepad is fine.
Step 1. Open Notepad. You can do this by searching for the word “Notepad” in the Start menu or by executing the notepad command in the Run dialog box (WIN + R).
Step 2. Copy the script exactly as shown above and paste it into Notepad.
Step 3. Edit the file rename script to apply to your unique situation.
To do this, you need to change the text named ENTER PATH HERE to the folder that contains your files that will be renamed soon.
For example, you want to rename a group of files in a folder on your desktop, in which case the folder path might look like this: C: Users Matt Desktop Converted MP3s .
To make the script always apply to the folder it is currently in, just change the path to. . That is, a period followed by a backslash without a space. Using a script in this way allows you to place it in any folder and automatically apply only to that folder.
Also change ORIGINAL to the characters you want to replace and remove the REPLACEMENT so you can enter text that should replace the original characters. In other words, you can read this script line as â€œ replace THIS with THIS. “
Note. Be sure to save quotes every time you see them. They should remain in the folder path and in the replacement section.
Step 4: Go to File Save As and name the file whatever you want, but be sure to change the Save As Type option to All Files (*) and add .vbs to the end of the file name.
Step 5. You can now close Notepad and run the VBS file to apply the script.
This is it! To edit a VBS file to change the location of the files to rename or customize overrides in files, simply right-click the VBS file as shown above, but instead of opening it, choose Change.
How to bulk rename files in Windows 10
If you’re using Windows 10, there is a built-in rename feature that is easy to use and might be exactly what you need. This method is unique compared to the above scenario in that it works even if the files have completely different file names.
In other words, the two methods have completely different use cases. Let’s say you have 100 files, each with the word “home” and other random characters. You want to leave all the symbols intact, but turn the word “home” into a home. The script is great for this.
However, if all 100 files have random character names and you want them to really look like home pictures, you can use Windows 10’s rename feature to rename the first to housepics (1), the second to housepics (2), the third to homepics. photo (3), etc.
Here’s how to do it on Windows 10:
Step 1. Select the files you want to rename.
Step 2. Press the F2 key or right-click one of the selected files and select Rename.
Step 3. Enter the file name you want to use and press Enter.
Instantly, every selected file will use the same filename. If each file uses a different file extension, they will all be named the same, but if they have the same file extension, a number will be appended to the end, since two or more files cannot use the same file name in the same folder.