Ren (command)


In computing, ren is a command in various command-line interpreters such as COMMAND.COM, cmd.exe, 4DOS, 4NT and Windows PowerShell. It is used to rename computer files and in some implementations also directories. It can also move a file to a new path, if it is on the same device. It is analogous to the Unix mv command. However, unlike mv, 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, 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.

Implementations

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.
Stratus OpenVOS, DEC RT-11, RSX-11, OS/8, 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 ren.
The 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 and commands.
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 rename.
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.

Example


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"