Whats the difference between rename and move?

There's two main differences:

  1. rename cannot move files to another directory or drive, move can.

  2. rename cannot overwrite existing files, move can (using the /y parameter).

For more information, see the documentation for rename and move.


Assuming the traditional cmd.exe shell:

rename cannot move files to a different directory.

move *.txt E:\Notes

But it can rename multiple files at once. For example:

rename very-long-name.c *.cpp

rename *.txt *.lol

rename proj1.* "Project 1.*"

(This works because the MS-DOS command.com and Windows cmd.exe shells, unlike their Unix counterparts, do not expand wildcards automatically – this is left for the program itself.)


There are two good answers already, but I'm compelled to mention a difference that hasn't been mentioned yet, and that's the syntax itself. If you want to move a file and you use rename, you'll have to put the same name in twice.

move MyFile.txt MyFolder

versus

rename MyFile.txt MyFolder\MyFile.txt

Tags:

Windows