Recently I needed to convert a large number of photo file extensions to lower case. Doing this manually would take ages and wouldn’t be a fun job.
I wrote a quick batch file to look through all the sub-directories from the one it is executed from and change selected file extensions to lower case.
To use this script place the below code in a file called lowerCaseExtensions.bat. Put the batch file in the directory containing the files that you want changed and double click on it.
The script will loop through all the files in the directory, and will loop thought the files in all sub-directories and will change jpg, png and gif extension to lower case.
@echo off setlocal pushd . goto :skip_functions :toLower cd %1 echo Processing %1 ren *.JPG *.jpg 2>&1 ren *.PNG *.png 2>&1 ren *.GIF *.gif 2>&1 goto :EOF :skip_functions for /f %%i in ('dir /b/s/ad') do call :toLower %%i popd endlocal
You can easily customise this to change the file extensions of other file types to lower case.
This has been tested only on my Windows XP computer so I’d suggest you test it first on some copied files before you let it lose on your real ones.
Even if you aren’t specifically interested in the functionality that this batch file implements you might find it interesting to see how to implement a simple callable function in a batch file (:toLower), and how to implement ‘for’ loops.