How To Rename Files and Folders in Windows CMD
![rename files windows](https://storage.googleapis.com/static.configserverfirewall.com/images/windows10/cmd/windows-rename-files.webp)
The ren
(or rename
) command can be used to rename files and folders in the Window command prompt (CMD).
The syntax of the rename
command is as follows:
rename file-name new-file-name
Examples
Rename file1.txt to file2.txt:
ren file1.txt file2.txt
![rename files windows](https://storage.googleapis.com/static.configserverfirewall.com/images/windows10/cmd/rename-files-cmd.webp)
Rename the name of a directory from Pictures to Documents:
ren Pictures Documents
![cmd rename folder](https://storage.googleapis.com/static.configserverfirewall.com/images/windows10/cmd/cmd-rename-folder.webp)
Use quotation marks if the file or folder name contains spaces:
ren "New folder" "Documents"
The ren
command supports wildcards to rename multiple files at once. For example, the following command renames the extension of all files in a folder (from .txt
to .doc
):
ren *.txt *.doc
Note that you can’t move files from one directory to another with the ren
command. For that, use the move command.