Renaming with case sensitivity in Windows

Started by CloudedGenie, August 10, 2017, 12:45:41 PM

Previous topic - Next topic

CloudedGenie

I have finally started sorting through the mess of various filing and renaming strategies that I've had, and finally fixing those files where I forgot to fix the time on the camera...

I discovered that all the files I've renamed or edited with exiftool, have been renamed with both the filename and extension in lowercase, while the original filenames from the camera are in uppercase. I know that Windows is not case sensitive, and this will make no real difference, but is there a way to force the filename to be all uppercase?

I am slightly OCD and this is driving my up the wall..

I found some scripts and batch files for Windows 7 to rename all files to lower case, but that means I would have to keep doing this on an ongoing basis, rather than than just fix the existing mess.
Windows 10
Nikon D800E, D200, D80, every iPhone produced, GoPro, some old compact cameras, and a mountain of scanned negatives and prints

Phil Harvey

There are various ways.  If you are using %e when setting FileName, you can use %ue for uppercase.  To change an entire directory:

exiftool "-filename=%f.%ue" DIR

- Phil

Edit: Hmm.  I just tried this and it doesn't work on Mac because the system tells exiftool that the destination filename already exists, so ExifTool won't try to rename the file.  This could also happen on Windows.  To avoid this, you could go through a temporary directory:

1. exiftool -filename="tmp/%f.%ue" DIR

2. exiftool -directory="DIR" tmp
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

CloudedGenie

Thanks for the quick response, Phil.

I tried it on Windows, and got the same error, that the filename already exists. It did work for the file that I renamed with the original FileNumber value, using

exiftool "-FileName<JVR_${FileNumber}.%ue" FILE

Even if I just update the timezone in the file, the updated file is in lowercase (I know that is because exiftool writes a temporary file and renames it). Is saving all the updated files directly into in a tmp directory (and renaming them to uppercase) the best way, or is there another way change that to be the default exiftool behaviour?
Windows 10
Nikon D800E, D200, D80, every iPhone produced, GoPro, some old compact cameras, and a mountain of scanned negatives and prints

Phil Harvey

ExifTool has no default case for file extension.  It should leave the case the same as it was originally, or set it to whatever you specify in your command.

Once they are lower-case, it will require 2 steps to be able to get them back to uppercase using ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).