REN: Renaming a File or Folder

You use the REN (or RENAME) command to change the name of one or more files and folders. Here’s the syntax:

REN old_filename1 new_filename

old_filename

The original filename

new_filename

The new filename

For example, the following command renames Budget 2012.xlsx to Budget 2013.xlsx:

ren "Budget 2012.xlsx" "Budget 2013.xlsx"

A simple file or folder rename such as this probably isn’t something you’ll ever fire up a command-line session to do because renaming a single object is faster and easier in File Explorer. However, the real power of the REN command is that it accepts wildcards in the file specifications. This enables you to rename several files at once, something you can’t do in File Explorer.

For example, ...

Get Windows 8 In Depth now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.