ExifTool Forum

ExifTool => Newbies => Topic started by: lclarke522 on July 28, 2014, 10:59:15 AM

Title: Using date formatting in a batch file
Post by: lclarke522 on July 28, 2014, 10:59:15 AM
Hello! I am trying to execute the following (which works fine from the command line) in a batch file:

exiftool -d %Y-%m%%-c.%%e "-testname<$createdate" *.jpg

I thought I'd need to escape the % with another % sign, but when I use this command in a batch file:

exiftool -d %%Y-%%m%%-c.%%e "-testname<$createdate" *.jpg

I get this result: %Y-%m-106.jpg

I am looking to get: 2014-07-106.jpg

Any help would be appreciated!
Title: Re: Using date formatting in a batch file
Post by: Phil Harvey on July 28, 2014, 02:07:17 PM
You need to double all of the %'s:

exiftool -d %%Y-%%m%%%%-c.%%%%e "-testname<$createdate" -ext jpg .

- Phil
Title: Re: Using date formatting in a batch file
Post by: lclarke522 on July 28, 2014, 03:51:34 PM
Oh, thank you!

I had tried at one point changing the %% to %%% but it didn't help. I see why now.

Thanks for your help, and thanks for your great software. I've been nerding out on it all week.