Recursively rename files through the command line (Windows 7)

13

9

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.

David Gard

Posted 2012-01-07T10:18:59.303

Reputation: 1 368

Question was closed 2012-01-07T20:36:59.953

Same question as this: http://superuser.com/questions/205083/command-line-recursive-rename-move-in-windows

– Sencer H. – 2012-01-07T10:43:20.793

Answers

38

With a for loop, with recursive switch:

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

aleroot

Posted 2012-01-07T10:18:59.303

Reputation: 1 143

1

I had to use for /R %G in (.m4v) do ren "%G" "%~nG.avi" as in https://ss64.com/nt/for_r.html

– sea_jackal – 2018-10-03T20:01:15.887