KOMPX.COM or COMPMISCELLANEA.COM   

Renaming files in DOS

  1. Renaming by REN command
  2. Renaming by MOVE command

REN or RENAME

Changing name of a specific file in the current directory:


REN FILE1.TXT FILE2.TXT

Changing filename extension of a specific file in the current directory:


REN FILE1.TXT FILE1.HTM

Using wildcards to change extension of all files in the current directory from txt to htm. Only extensions are changed, the file names proper are left as they were.


REN *.TXT *.HTM

Since REN is the synonym for RENAME command, RENAME may be used instead - as more self-explaining may be.

More details and examples: ss64.com/nt/ren.html.

MOVE

Changing name of a specific file in the current directory:


MOVE FILE1.TXT FILE2.TXT

Changing filename extension of a specific file in the current directory:


MOVE FILE1.TXT FILE1.HTM

More details and examples: ss64.com/nt/move.html.

Both methods of file renaming work in Windows command prompt as well. But there is a nuance though: MS-DOS and other typical / older DOS'es, command prompt of Windows prior to Windows 95 and Windows NT 3.51 use a short filename (8.3 filename convention). So, for example, REN FILE1.HTM FILE1.HTML is not going to work, there will be "Duplicate file name or file name not found" message. That is not the case with newer DOS'es or command prompt of newer Windows. It can be not the case in older DOS'es as well - if relevant drivers are installed.

Operating systems
More