Windows ren
command is used to rename files and folder. ren
command provides command line renaming in MS DOS or cmd.exe.
Rename File
The most simple usage of ren
command is renaming one file. In this example we will provide the source or original file name and destination or new file name. Original file name is myfile
and new file name is yourfile
.
> ren myfile yourfile
Rename Multiple Files
If we have bulk list of files running ren
one by one is very trivial task. ren
re command support renaming multiple files in a single shot. This is generally used to change extension of files.
In this example we will rename all *.bak
extensions to the *.txt
files.
> ren *.bak *.txt
Rename Directory
As well as directories can be renamed with ren
command. This is the same as renaming file. In this example we will rename file named test
into mytest
.
>ren test mytest
Using Quotes
While working with different files and folders names we should take attention the names with spaces. Space is interpreter differently in MS DOS. So to make ren
command operations more safely we can surround files and directory names with "
double quotes.
> ren "My File" "Your File"
I use, Batch Rename Files Tool. You can easily found hier go to google and type BatchRenameFiles and check the first result that allows you to quickly rename all the files in a specified directory.