Ren


Applies To: Windows Vista,Windows Server 2003,Windows Server 2000,Windows 7,Windows Server 2003 R2,Windows Server 2008,Windows Server 2008 R2,Windows XP

Renames files or directories. This command is the same as the rename command.

For examples of how to use this command, see Examples.

Syntax


Copy Code

ren [<Drive>:][<Path>]<FileName1> <FileName2>
rename [<Drive>:][<Path>]<FileName1> <FileName2>

Parameters

Parameter

Description

[<Drive>:][<Path>]<FileName1>

Specifies the location and name of the file or set of files you want to rename. FileName1 can include wildcard characters (* and ?).

<FileName2>

Specifies the new name for the file. You can use wildcard characters to specify new names for multiple files.

/?

Displays help at the command prompt.

Remarks


Copy Code

Duplicate file name or file not found

Examples

To change all the .txt file name extensions in the current directory to .doc extensions, type:


Copy Code

ren *.txt *.doc

To change the name of a directory from Chap10 to Part10, type:


Copy Code

ren chap10 part10

Additional references

Command-Line Syntax Key