•Arnošt Havelka
The Rename Command
Give files new names.
Start Interactive LessonThe ren (or rename) command is straightforward: it changes the name of a file. It cannot move files to a different directory; for that, you need move.
Try the command
Try renaming a file!
Build the command
ren
filenameThe current name of the file.
newnameThe new name for the file. Note: You cannot specify a new path here.
Terminal
C:\Users\Student>ren draft.txt final.txt
Real-World Examples
Simple rename:
Terminal
C:\Users\Student>ren raw_data.csv data_2024.csv
Bulk rename extensions:
Terminal
C:\Users\Student>ren *.htm *.html
Knowledge Check
1 / 2Can 'ren' move a file to another folder?
References
These documentation links provide authoritative details for the commands used in this article.
Up Next
How to Move Files and Folders in CMD with move
Learn to move files and folders, rename them, and control overwrite prompts with the CMD move command and /y switch.