RENAME.COM
| Company type | Shell utility |
|---|---|
| Industry | Computer software |
| Products | File and directory renaming |
ren (also known as rename) is a shell utility used to change the name of a file and, depending on the implementation (for example, AmigaDOS), it can also rename directories. Certain shells that include ren additionally offer a move command to transfer files between folders. On platforms without an inherent move command, users typically perform file relocation by copying followed by deletion. In the DOSBox environment, ren supports moving files as well.
This command is found in multiple shell environments such as COMMAND.COM, Command Prompt, 4DOS, 4NT, and PowerShell. It has been part of MS-DOS since its initial release with version 1.[1] Within PowerShell, ren functions as a shortcut for the Rename-Item cmdlet.Cite error: The opening <ref> tag is malformed or has a bad name
Equivalent commands are standard features in numerous operating systems including CP/M, MP/M, Cromemco DOS, TRIPOS, OS/2, ReactOS, SymbOS, DexOS, among others. The Multics system provides a rename command which can be abbreviated to rn. Additional variations appear in platforms like Stratus VOS, RT-11, OS/8, RSX-11, ISIS-II, iRMX 86, TOPS-20, Z80-RIO, FLEX, OS-9, FlexOS, 4690 OS, MPE/iX, THEOS/OASIS, and OpenVMS.
Legacy operating systems such as 86-DOS and DR DOS 6.0 also support this command,[2] along with implementations like PC-MOS.Cite error: The opening <ref> tag is malformed or has a bad name The command remains functional in emulation software including DOSBox.
Example
To rename a file from foo to bar, use the following syntax:
<syntaxhighlight lang="doscon"> > ren foo bar </syntaxhighlight>
When renaming a file by specifying its full path, the initial argument may contain the drive letter and directory path; however, the second argument must only be the new file name:
<syntaxhighlight lang="doscon"> > rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" Wildlife2.wmv </syntaxhighlight>
In Command Prompt, to eliminate the prefix abcd from file names, apply these guidelines:
- The count of
/characters corresponds to how many characters are removed - Both parameters should be enclosed in double quotes
- File extensions (the dot character) cannot be removed
<syntaxhighlight lang="doscon"> > rename "abcd*.txt" "////*.txt" </syntaxhighlight>