In windows console (cmd/command) you can write rename a b
or move a b
. Whats the difference between the two?
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