Friday, September 23, 2011

How to change my file names to lowercase?

Hi I need help fast! I have a yahoo store and to upload photos I need to have all my file names in lower case. I'm not interested in downloaded something from a 3rd party so please don't suggest it unless it's legit and you can prove it. Is there a way to do this on my computer. I'm using windows vista and have Microsoft. I'm having so much trouble with uploading these items to my yahoo store but nobody can help me...not even yahoo! (I've called over 6 times today!) Please let me know how to do this or is there a simple solution. I have to upload over 500 pictures to my yahoo store and don't want to do it individually. Thanks!How to change my file names to lowercase?Although Microsoft supports mix cased files, this is for presentation only by default (you can edit a registry value to make it case sensitive, but Microsoft doesn't recommend it). In order to change to lower case, you'll need to change it in two steps. The CYGWIN that Fred W recommended would be my choice, but you don't absolutely need it.



In essence, you will want a script that lets you rename the files to something new, then renames back with the appropriate case.



So for a single file, you'd go something like this:



MyFile1.jpg -%26gt; myfile1_tmp.jpg -%26gt; myfile1.jpg



I put the %26quot;_tmp%26quot; so Microsoft wouldn't complain that nothing changed. You can't go directly from:



MyFile1.jpg -%26gt; myfile1.jpg



Microsoft just doesn't see a difference between them unless you use an intermediate step (I wish I could smack someone at Microsoft for not understanding that case matters).How to change my file names to lowercase?You really should have picked Fred W's answer since his contains a bit more details on actually using the CYGWIN. All I did was explain the limitation of the MS Windows OS in relation to the file case sensitivity.

Report Abuse

How to change my file names to lowercase?The only way to change a file name name is to right click and then select rename.How to change my file names to lowercase?Since they are all unique file names, the only way it is going to happen is to rename each one of them manually.How to change my file names to lowercase?Download CYGWIN (cygwin.org). Run the SETUP.EXE -- all you need is the basic setup.



After launching the CYGWIN shell:



cd /cydrive/c/...path to your folder...



Now, run the following:



find . -type f -exec echo mv {} \`echo {} \| tr A-Z a-z\` \; | sh



and that should do it.



Let's look at the command --



find . -type f %26quot;Find from the current directory, for all things that are files%26quot;



-exec %26quot;On each of these objects (files), execute this%26quot;



echo %26quot;Execute the echo command, which writes to the standard output%26quot;



mv {} %26quot;Move (rename) the object, filling in the {} from the find command%26quot;



\` %26quot;Take up to the matching \', and execute this early%26quot;



echo {} %26quot;Write out the filename%26quot;

| tr A-Z a-z %26quot;transliterate A-Z (uppercase) to a-z (lowercase)%26quot;



\` %26quot;Finish up the \`%26quot;



\; %26quot;Finish the -exec%26quot;



When run in a directory with two files AB and cd, for example, this part produces:



mv AB `echo AB | tr A-Z a-z`

mv cd `echo cd | tr A-Z a-z`



This is then piped into sh (shell)

| sh



When then runs these commands



mv AB `echo AB | tr A-Z a-z'



becomes %26quot;mv AB ab%26quot;, because the ` evaluates and substitutes. The second becomes %26quot;mv cd cd%26quot;.



The mv AB ab renames the file (as you wanted) -- mv cd cd produces an error (which you ignore).



CYGWIN is a free implementation. You can also use Unix tools for Windows from Microsoft (also free, I believe).



Or... rename them manually.How to change my file names to lowercase?I suggest contacting Steve Cochran on the internet. He is a Microsoft MVP. He helped me recover some lost files.How to change my file names to lowercase?open notepad and paste the line below this:

for /F %a in ('dir /b /l') do rename %a %a



after that save the notepad as %26quot;renameLower.bat%26quot;

then if you double click (run) that fie, it will change all the files in your folder into lower case

the problem is it cannot rename the files on the child folder. you need to move/copy the %26quot;renameLower.bat%26quot; to the child folder then run it again.



To Jim (below me), haven't tried it on windows XP and vista, but the code above worked on win 7.

No comments:

Post a Comment