- SPLessons

Change all file names to lowercase in windows

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Change all file names to lowercase in windows

Changing All File Names to Lowercase in windows

Description :

Hi every one, today we are going to see to how change all file names to lowercase in windows. Recently I got a situation where I have 225 country flag images but some images names are in lowercase and some image names are in uppercase I want to use all 225 country flag images in my program so there I have to convert all the country flag image names into either in lowercase or in uppercase. So it’s very difficult to convert all the 225 country flag image names into lowercase or uppercase manually. So I decided to write a batch command which will convert all the image names into lowercase letters. We are going to see how the batch command  will be looks like.

Steps :

1) Simply copy the bellow code

2) Paste it into a notepad and save the notepad as “renamefiles.bat”.

3) Put the “renamefiles.bat” in directory your files resides.

4) Just double click ( Run ) on the batch file, boom all the files will be rename to lower cases.

for /F %%a in ('dir /L /B') do rename %%a %%a

More Information

The bellow code is the syntax of command

FOR %variable IN (command) DO command [command-parameters]

1) FOR is works like for loop in any programming langues. In normal normal terminology, iterating of all the files in current directory.
2) %variable it holds the names of files which we want to convert to lower or upper case. Eg: a=UsA_flag.jpg or a=India_flag.jpg
3) command here we have pass command to get the only names of file or directories but not date, time and other info. Eg: /B
5) DO is just what action to perform.
6) Command-parameters we will tell what to do. Eg: rename lower or upper case. ” rename %%a %%a

Please feel free to command if you have some doubts.
Stop Thinking, Start Coding… 🙂