I need a way to rename all files in folders and subfolders to lowercase.

I'd like to know if there is a way to do that using only windows (XP or 7)

link|improve this question

windows doesn't differentiate between small and upper caps as unix does. maybe, if you said, why you need this, it would help in solving the problem. – ldigas Nov 4 '09 at 0:47
@Idigas. Sorry, but since NTFS, filenames have been case sensitive. See support.microsoft.com/kb/100625 – DaveParillo Nov 4 '09 at 6:49
Just great. Take a bad idea and spread it further. What a support nightmare when someone sends a file and a fat finger mistake means they sent "Answers.dat" and the incoming process expects "answers.dat". There's just no good reason for those two names to be considered 'different'. – David Nov 4 '09 at 12:45
1  
@David, for example Java actually requires case-sensitive file names. That can yield a lot of trouble on non-case-sensitive file systems. – Arjan Nov 4 '09 at 17:26
feedback

8 Answers

up vote 4 down vote accepted

Do you require a GUI-based solution or a command line interface (CLI)?

It may be easier to use the CLI option since you won't have to deal with installing more applications or searching for a free application to suite your needs.

Since you mentioned "batch", I leave you with this excellent article which is nearly cut & paste to get you on your way in minutes: JSI Tip 0568 - How do I convert a file name to lowercase?

link|improve this answer
I was perfering a GUI but since it seems it's not built in, this is the type of thing I was looking for, but doesn't rename the directories though... I removed the /a-d and now it does. – ino Nov 4 '09 at 11:46
The article had a link to another solution with folder renames as well: windowsitpro.com/articles/index.cfm?articleid=81612 – Even Mien Dec 5 '09 at 19:49
feedback

spacetornado Renamer is a Windows program that renames mass amounts of files in batches. You can search and replace text, remove a certain number of characters, change the case to lower, upper or First Letter Capital, and add text to the beginning or end (append/prepend) of every filename

enter image description here

link|improve this answer
Please give me the reason for down vote ? – joe Nov 4 '09 at 8:52
1  
People rarely explain, unfortunately :/ – Gnoupi Nov 4 '09 at 9:02
1  
I guess the downvote was because the OP wanted a solution that worked without any additional software. And I guess the downvote wasn't explained because some people are prone to deal out revenge downvotes. – innaM Nov 4 '09 at 12:20
The GUI is a little funky but it does the job better than several other renamers that I've seen out there. – jcollum Nov 23 '10 at 21:46
+1 Just what I needed. – starblue Mar 28 at 13:29
feedback

From http://windowsitpro.com/articles/index.cfm?articleid=81612:

Using only standard commands, I have scripted LwrCase.bat and LwrCase_Folder.bat, to rename a file name to lower case, or rename all file names in a folder to lower case.

To rename a file name to lower case, use:

[call] LwrCase FullyQualifiedFileName

Where FullyQualifiedFileName is the fully qualified file name to be renamed.

To rename all the files names in a directory, use:

[call] LwrCase_Folder FullyQualifiedDirectoryName [/S]

where FullyQualifiedDirectoryName is the fully qualify folder path, and /S is an optional parameter that will also rename files names in all sub-folders.

NOTE: LwrCase.bat makes use the the /L switch of the DIR command, which returns lower case names.

LwrCase.bat contains:

@echo off
if {%1}=={} @echo Syntax: LwrCase FullyQualifiedFileName&goto :EOF
if not exist %1 @echo LwrCase - %1 NOT found.&goto :EOF
setlocal
for /f "Tokens=*" %%a in ('@echo %~a1') do (
 set file=%%a
)
if /i "%file:~0,1%" EQU "d" @echo LwrCase - %1 is NOT a file.&endlocal&goto :EOF
for /f "Tokens=*" %%f in ('dir %1 /L /b /a /a-d') do (
 Rename %1 "%%f"
)
endlocal

LwrCase_Folder.bat contains:

@echo off
if {%1}=={} @echo Syntax: LwrCase_Folder FullyQualifiedDirectoryName&goto :EOF
if not exist %1 @echo LwrCase_Folder - %1 NOT found.&goto :EOF
setlocal
for /f "Tokens=*" %%a in ('@echo %~a1') do (
 set folder=%%a
)
if /i "%folder:~0,1%" NEQ "d" @echo LwrCase_Folder - %1 is NOT a folder.&endlocal&goto :EOF
pushd %1
set sw=/B /A /A-D
if /i {%2}=={/S} set sw=%sw% %2
for /f "Tokens=*" %%f in ('dir %sw%') do (
 call LwrCase "%%f"
)
popd
endlocal
link|improve this answer
feedback

http://www.dostips.com/DtCodeCmdLib.php#Function.toLower gives a simple function that you should be able to include and call from a batch file.

So have the batch file iterate over the folders/filenames, and call this function to generate the lowercase version of the name.

link|improve this answer
feedback

My personal favorite batch file-renaming utility is Cylog's WildRename. Among many other features, it can change the case of filenames. The best thing about WildRename is probably that it supports regular-expressions!

link|improve this answer
feedback

The best program for doing this in Windows is Bulk Rename Utility. It is a mans tool. You can even use regex to rename files and/or folders. It also has shell integration (so you can execute from explorer with a right click) which is very nice. 64 bit and 32 bit versions available.

link|improve this answer
feedback

Go to the directory and run the following command:

for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")
link|improve this answer
feedback

When you say 'only windows (XP or 7), does this exclude using Python?

I saw this answer:

Something as simple as http://www.palovick.com/code/python/python-rename-files.php will handle it.

in this post.

I can't vouch for this but it may be what you are looking for.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.