UnjamKit
SMALL FIXES. BACK TO WORK.
GUIDE / BATCH RENAME

How to rename files from an Excel list.
Old name in, new name out.

Put the current file names in column A and the new names in column B. Then either let a script rename the files in place (PowerShell on Windows, Terminal on a Mac), or paste the two columns into a browser tool that shows every old and new name, blocks duplicates and invalid names, and gives you renamed copies in a ZIP. Whatever you use, check the list first: most failed renames come from a typo, a hidden extension or two rows with the same new name.

First, build a clean list

Four ways to rename from the list

1. PowerShell (Windows, renames in place)

Give the two columns the headers Old and New and save the sheet as CSV UTF-8 into the folder with the files, as rename.csv. In File Explorer, open that folder, type powershell in the address bar and press Enter, then run:

Import-Csv .\rename.csv -Encoding UTF8 | ForEach-Object { Rename-Item -LiteralPath $_.Old -NewName $_.New }

Each row renames one file. Errors are printed for rows whose file is missing or whose new name already exists. There is no undo, so try it on a copy of the folder first.

2. A cmd batch file built with a formula (Windows)

In column C, enter ="ren """&A2&""" """&B2&"""" and fill it down. Copy column C into Notepad, save it as rename.bat in the folder with the files and double-click it. This works well for plain English names; names with Chinese, accented or other non-Latin characters can break in cmd, so use PowerShell for those.

3. Terminal (Mac)

Save the two columns, without a header, as rename.csv in the folder. In Terminal, type cd and a space, drag the folder into the window, press Enter, then run:

while IFS=, read -r old new; do new="${new%$'\r'}"; mv -n -- "$old" "$new"; done < rename.csv

-n refuses to overwrite an existing file. This simple loop cannot handle names that contain commas.

4. A browser tool that checks first (any computer)

Batch Rename takes the files and the two columns pasted from Excel (or the .xlsx itself), matches each file to its row and shows old and new names side by side. It marks files with no row, rows with no file, duplicate names and characters Windows rejects before anything downloads, then gives you renamed copies in a ZIP with a rename list. Nothing is installed or uploaded, and the originals are not touched, which also makes it the safest way to try a list before renaming in place.

Which method fits

MethodRenames in placeChecks the list firstBest for
PowerShellYesNo, errors appear as it runsLarge folders on Windows
cmd batch fileYesNoShort lists of English names
Mac TerminalYesNoMac users comfortable with Terminal
Batch Rename (browser)No, makes renamed copiesYes, every rowLocked-down PCs, delivering files with a list, checking a list

Questions

Can Windows rename from a list without a script?

No. File Explorer and PowerToys PowerRename rename by pattern (find and replace, numbering), not by a list of individual new names. For a list you need a script or a tool that reads one.

How do I undo a list rename?

Swap the two columns and run the same method again: the new names become the old ones. Batch Rename does this for you when you load the rename-list.csv it put in the ZIP.

What if only some files are in the list?

Scripts skip rows they cannot match and leave other files alone. In Batch Rename you choose whether unlisted files are flagged, kept with their original names or left out of the ZIP.

Last updated