Windows Batch script snippets

How to massive rename files in folder

You just have to copy the following code and past into Notepad, then save with .cmd extension and execute it from the path you want to rename.

Rename batch script

rename	"OldName_001.pdf"	"NewName_001.pdf"
rename	"OldName_002.pdf"	"NewName_002.pdf"
rename	"OldName_003.pdf"	"NewName_003.pdf"
rename	"OldName_004.pdf"	"NewName_004.pdf"
rename	"OldName_005.pdf"	"NewName_005.pdf"
rename	"OldName_006.pdf"	"NewName_006.pdf"
rename	"OldName_007.pdf"	"NewName_007.pdf"
rename	"OldName_008.pdf"	"NewName_008.pdf"
Nicola Simboli

Nicola Simboli Senior Analytics Engineer

15+ years across SaaS, enterprise and consulting. Focused on scalable data platforms, metric reliability and analytics systems that teams actually use.

Back to Windows Batch script cookbook page