Windows CMD Rename Command - Complete Guide with Examples
Mahesh Waghmare The REN (or RENAME) command in Windows Command Prompt allows you to rename files and folders. This guide covers all aspects of renaming in CMD.
Introduction to REN Command
REN is the Windows command for renaming files and directories. It’s a simple but powerful tool for file management.
Syntax:
REN [drive:][path]filename1 filename2
Key Points:
- Works with files and folders
- Can use wildcards
- Simple syntax
- Fast operation
Basic Usage
Rename Single File
ren oldname.txt newname.txt
Rename with Path
ren C:\folder\oldname.txt newname.txt
Rename Folder
ren oldfolder newfolder
Rename Files
Change Extension
ren file.txt file.doc
Remove Extension
ren file.txt file
Add Extension
ren file file.txt
Rename Folders
Basic Folder Rename
ren oldfolder newfolder
Folder with Spaces
ren "old folder" "new folder"
Batch Renaming
Using Wildcards
ren *.txt *.bak
Renames all .txt files to .bak.
Sequential Renaming
for /L %i in (1,1,10) do ren file%i.txt newfile%i.txt
Advanced Techniques
PowerShell Alternative
For more advanced renaming, PowerShell offers more features:
Get-ChildItem *.txt | Rename-Item -NewName { $_.Name -replace 'old', 'new' }
Conclusion
REN command provides:
- Simple file renaming in CMD
- Folder renaming capability
- Wildcard support for batch operations
- Fast execution for file management
Key Points:
- Use REN for simple renames
- Wildcards enable batch operations
- Works with files and folders
- Use quotes for names with spaces
Mastering REN command improves Windows file management efficiency.
Written by Mahesh Waghmare
I bridge the gap between WordPress architecture and modern React frontends. Currently building tools for the AI era.
Follow on Twitter →