Stymied by -IF condition

Started by robertklink, December 26, 2019, 06:08:05 PM

Previous topic - Next topic

robertklink

Using CMD window on Windows 10 OS.

I want to increment ModifyDate (EXIF 0x132) by 1 year, but only IF the current ModifyDate is prior to 2019 - having difficulty with the IF portion.

Should be simple I'm thinking.
Here's the command that I think should work:
exiftool -ModifyDate+="1:0:0 0:0:0" -if "$ModifyDate lt "2018:12:31"" "C:\Users\rober\Pictures\Advance DTO 1 year Sandbox\1990"

Result is:
1 directories scanned
  463 files failed condition
    0 image files read

I know that there are lots of files in that directory with ModifyDates in the vicinity of 2018:03:31 12:23:04

I've tried numerous permutations of the above command (e.g. le, <, 2020:01:01) but they yielded either the same "failed condition" or some other syntax complaint. The "add one year" command works fine WITHOUT the -IF portion.

Suggestions please?






StarGeek

You need double quotes on the outside, single quotes inside.

exiftool -ModifyDate+="1:0:0 0:0:0" -if "$ModifyDate lt '2018:12:31' " "C:\Users\rober\Pictures\Advance DTO 1 year Sandbox\1990"

Example:
C:\>exiftool -ModifyDate y:\!temp\Test4.jpg
Modify Date                     : 2018:03:31 12:23:04

C:\>exiftool -P -overwrite_original -ModifyDate+="1:0:0 0:0:0" -if "$ModifyDate lt '2018:12:31' " y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -ModifyDate y:\!temp\Test4.jpg
Modify Date                     : 2019:03:31 12:23:04
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

robertklink

Yea! That fixed it. That's the bad of taking a Linux example and blithely swapping double quotes for Windows.