Recursively rename files through the command line (Windows 7) [duplicate]

Possible Duplicate:
Which command can I use to recursively rename or move a file in Windows?

Is there a way, through the command line, to recursively rename all .m4v files to .avi?

ren *.m4v *.avi only works for the folder(s) selected, and ignores the folders under them, and as best I can tell there is no recursive parameter with that function.


Solution 1:

With a for loop, with recursive switch:

for /R %x in (*.m4v) do ren "%x" *.avi