Batch Script Renaming Files
Renaming Files
In Batch Script, you can rename files with the ren
or rename
command.
Syntax
RENAME [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
Examples
The following command will rename all text files to files with .bak extension.
rename *.txt *.bak
The following command will rename the file test-a.txt to test-b.txt.
rename "test-a.txt" "test-b.txt"