|Developer(s)||Various open-source and commercial developers|
|Operating system||OpenVOS, RT-11, OS/8, RSX-11, ISIS-II, iRMX 86, TOPS-20, Z80-RIO, FLEX, CDOS, OS-9, FlexOS, PC-MOS, 4690 OS, MPE/iX, THEOS/OASIS, OpenVMS, CP/M, MP/M, TRIPOS, AmigaDOS, DOS, MSX-DOS, SISNE plus, OS/2, Windows, ReactOS, SymbOS, DexOS|
rename) is a command in various command-line interpreters (shells) such as
cmd.exe, 4DOS, 4NT and Windows PowerShell. It is used to rename computer files and in some implementations (such as AmigaDOS) also directories. It is analogous to the Unix
mv command. However, unlike
ren cannot be used to move files, as a new directory for the destination file may not be used. Alternatively,
move may be used if available. On versions of MS-DOS that do not support the
move command (older than 6.00), the user would simply copy the file to a new destination, and then delete the original file. A notable exception to this rule is DOSBox, in which
ren may be used to move a file, since
move is not supported.
The command is available in the operating systems Digital Research CP/M, MP/M, Cromemco CDOS, MetaComCo TRIPOS, DOS, IBM OS/2, Microsoft Windows, ReactOS, SymbOS, and DexOS.
Multics includes a
rename command to rename a directory entry. It can be contracted to
Stratus OpenVOS, DEC RT-11, OS/8, RSX-11, Intel ISIS-II, iRMX 86, TOPS-20, Zilog Z80-RIO, TSC FLEX, Microware OS-9, DR FlexOS, IBM/Toshiba 4690 OS, HP MPE/iX, THEOS/OASIS, and OpenVMS also provide the
rename command which in some cases can be contracted to
rename command is supported by Tim Paterson's SCP 86-DOS. On MS-DOS, the command is available in versions 1 and later. DR DOS 6.0 also includes an implementation of the
In Windows PowerShell,
ren is a predefined command alias for the
Rename-Item Cmdlet which basically serves the same purpose.
TSL PC-MOS includes an implementation of
Like the rest of the operating system, it is licensed under the GPL v3.
It is also available in the open source MS-DOS emulator DOSBox.
>ren filename newname >ren *.htm *.html
Another example. This will rename a default video found in Windows 7 with a new name:
>rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" "Wildlife2.wmv"
The first parameter may contain a drive and a path, but the second parameter must contain only the new filename.
To remove certain characters of a file name in Microsoft Windows command prompt (XP & Higher) :
>rename "abcd*.txt" "////*.txt"
This will remove abcd from the file name.
/as the number of initial characters to remove.
.from file name