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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s