Rename Multiple Files at Once in Windows
Rename Multiple Files at Once in Windows
Do you need to rename several files at once in Windows? It can be quite the
task to do it manually, but Windows supports scripts that you can run to
automate the renaming process, saving you loads of time.
As an example, consider a case like in the example image above where you
have a folder of hundreds of images each named Copy of and then a word
or two, like Copy of Black Tea.jpg.
sNewFile = File.Name
sNewFile = Replace(sNewFile,”ORIGINAL”,”REPLACEMENT”)
if (sNewFile<>File.Name) then
File.Move(File.ParentFolder+”\”+sNewFile)
end if
Next
To use this script requires a text editor. Notepad, built-in to Windows, will do
just fine.
Step 1: Open Notepad. You can do this by searching for 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 it’s shown above, and paste it into
Notepad.
Step 3: Edit the file rename script to make it apply to your unique situation.
To make the script always apply to the folder it’s currently located in, just
change the path to .\. That is, a period and then a backslash, without a
space. Using the script this way lets you drop it into any folder and have it
automatically apply to only that folder.
Note: Make sure you keep the quotes in every instance you see them. They
need to remain in the folder path and the replace section.
Step 4: Go to File > Save As and name the file anything you like, but be
sure to change the “Save as type” option to All Files (*) and append .vbs to
the end of the file name.
Step 5: You can now close out of Notepad and execute the VBS file to apply
the script.
That’s it! To edit the VBS file to change the location of the files to rename, or
to adjust what to replace in the files, just right-click the VBS file like you see
above, but instead of opening it, choose Edit.
In other words, these two methods have completely different use cases. Let’s
say you have 100 files that each have the word house in them along with
other random characters. You want to keep all the characters untouched but
make the word house into home. The script is great for that.
However, if the 100 files are all named random characters and you want
them to be really similar like housepics, you can use the Windows 10
renaming function to rename the first to housepics (1), the second
to housepics (2), the third to housepics (3), and so on.
Step 2: Press the F2 key or right-click one of the selected files and
choose Rename.
Step 3: Type the filename you want to use and then press Enter.
Instantly, every selected file will use the exact same filename. If each file is
using a different file extension, they’ll all be named identically, but if they
have the same file extension, a number will be appended to the end since
two or more files can’t use the same filename in the same folder.