Dos script to rename all file extensions in a directory and subdirs

Here is a little dos script I wrote to rename all files in the current and subdirectories to have a different extension.

for /f "tokens=1 delims=" %a in ('dir /s /b /ad') do if exist "%a*.old" ren "%a*.old" *.new

If you run this from a bat file you will need to replace % with %%.

Leave a comment