Rename
Updated: January 21, 2005
Syntax
ren [Drive:][Path] FileName1 FileName2
Parameters
Remarks
- Renaming files
You can rename all files matching the specified file name. You cannot use the rename command to rename files across drives or to move files to a different directory location.
- Using wildcards with rename
You can use wildcards (* and ?) in either file name parameter. If you use wildcards in FileName2, the characters represented by the wildcards will be identical to the corresponding characters in FileName1.
-
Rename will not work if FileName2 already exists
If, for FileName2, you specify a file name that already exists, rename displays the following message:
Duplicate file name or file not found
Examples
ren *.txt *.doc
To rename a file or directory named Chap10 to Part10, type:
ren chap10 part10
Formatting legend
Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |