Ren (command)

In computing,   (or  ) is a command in various command-line interpreters (shells) such as,  , 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  command. However, unlike,   cannot be used to move files, as a new directory for the destination file may not be used. Alternatively,  may be used if available. On versions of MS-DOS that do not support the  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  may be used to move a file, since   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.

Multics includes a  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  command which in some cases can be contracted to.

The  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 ren and rename commands.

In Windows PowerShell,  is a predefined command alias for the   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.

Example
Another example. This will rename a default video found in Windows 7 with a new name:

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) :

This will remove abcd from the file name.

Notes:


 * 1) Same number of   as the number of initial characters to remove.
 * 2) Double quotes for both arguments.
 * 3) It doesn't remove    from file name