Rename and ren can be used interchangeably. They’re the exact same command.

Rename Command Availability

The rename command is available from within Command Prompt in most versions of Windows, including Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server operating systems, and some older versions of Windows, too. The rename command is also available from within the Recovery Console in Windows 2000 and Windows XP. See our Recovery Console commands list for more.

Rename Command Syntax

rename [drive:][path] filename1 filename2

Rename File in Specified Folder

In the above command, we’re renaming win.ini, located in the C:\Windows folder, to win.old.

Rename File in the Same Folder

In this one, the rename command has no drive: or path information specified, so the boot.new file is renamed to boot.ini, all within the directory you typed the rename command from. For example, if you type rename boot.new boot.ini from the C:> prompt, the boot.new file located in C:\ will be renamed to boot.ini.

Rename File Extension and Name

In this example, the rename command (shortened here to ren) is used not to rename the “normal” filename part but just the file extension, similar to the two example above. This isn’t something you’ll be doing often, but if you for some reason to do change the file extension, you can do so with the rename command. We’re renaming a backup with the bak file extension to a file with the REG file extension so that we can restore it to the Windows Registry (something you can only do if it ends in .reg). However, we’re also changing the name of the file to regfile, something we can do inside the same command so that we don’t have to run two separate commands.

Rename a Folder

In this last sample, we’re using the rename command to rename a folder instead of a file. The pictures folder will become vacation pics. Quotes are used around the folder name since it contains a space.

This command is often used with the dir command so that you can see the list of filenames within Command Prompt before choosing which one to rename.