How do I make a batch file that successfully runs this command....

Started by tomfer, January 31, 2012, 09:15:45 PM

Previous topic - Next topic

tomfer

I am trying to make a batch file that executes the following DOS command:

    exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S.%%e" "C:\Users\Tom\Desktop\belvedere"

If I paste the above command into the DOS command prompt, it works fine. However, if I paste this command into a text file, name it something.bat and run this batch file, it does not work well (it renames one photo to be "mHS.JPG" then gives errors. I believe that the % characters are the problem. Does anyone know how I can make a useful .bat file that runs this command?

Thanks in advance. 

ryerman

1) In a Windows BAT file the % character is represented by %%, so an argument like %d%f.txt is written as %%d%%f.txt.
Windows 10 Home 64 bit, Exiftool v12.61

Phil Harvey

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