Trying to Update FileCreatedate from Exif:Createdate

Started by ghelfrich919, February 24, 2021, 09:59:15 AM

Previous topic - Next topic

ghelfrich919

I am trying to Update FileCreateDate from Exif:Createdate from the CLI on win10 using following:

     exiftool "-FileCreateDate<Exif:Createdate" dir

But when I do, I am running into an issue.  The script runs and says it updates the images in the directory in the return message that says "X images were updated".  However, FileCreateDate is not actually updated with Exif:Creatdate.

From the tag documentation (https://exiftool.org/TagNames/Extra.html) it would appear FileCreateDate is writable using the CLI.  Possibly this is incorrect?  What am I doing wrong?

I changed the script to instead update FileModifyDate using following:

     exiftool "-FileModifyDate<Exif:Createdate" dir
   
When I do, both FileModifyDate and FileCreateDate are updated from Exif:Createdate.  For this, it's not clear to me why FileCreateDate is updating from this script.  Once again, what am I doing wrong?

Any help is greatly appreciated.  Thanks

Gerry

StarGeek

Are you using exiftool to view the FileCreateDate or something else? 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ghelfrich919

Yes, I am using exiftool 12.16 to view metadata as well.

Phil Harvey

Can you show specific examples?  I don't know about Windows, but on Mac if you try to set FileModifyDate to something before FileCreateDate then it will move FileCreateDate as well.

What is the output of this command before and after you try to change the dates?:

exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE

- 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 ($).

ghelfrich919

Ok, here is what I did: 

<1> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
Output:
[System]        File Creation Date/Time         : 2014:08:23 11:50:22-04:00
[System]        File Modification Date/Time     : 2014:08:23 11:50:22-04:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20

<2> Ran :  Exif "-FileCreateDate<Exif:Createdate" dir
Output:
    1 directories scanned
    2 image files updated

<3> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
Output:
[System]        File Creation Date/Time         : 2014:08:23 11:50:22-04:00
[System]        File Modification Date/Time     : 2014:08:23 11:50:22-04:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20

<4> Ran : Exif "-FileModifyDate<Exif:Createdate" dir
Output:
    1 directories scanned
    2 image files updated
   
<5> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
After Output:
[System]        File Creation Date/Time         : 2014:03:16 09:02:20-04:00
[System]        File Modification Date/Time     : 2014:03:16 09:02:20-04:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20

Phil Harvey

Hi Gerry,

Thanks.  That is certainly a problem.  What version of ExifTool are you running?  I haven't tested this myself on Windows in a while but it certainly worked at one time.  I'll run some tests myself when I get a chance.

- 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 ($).

StarGeek

I can't duplicate the problem here with ver 12.21
C:\>exiftool -filecreatedate -filemodifydate -createdate -a -G1 y:\!temp\Test4.jpg
[System]        File Creation Date/Time         : 2014:08:23 11:50:22-07:00
[System]        File Modification Date/Time     : 2014:08:23 11:50:22-07:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20

C:\>exiftool -P -overwrite_original "-FileCreateDate<Exif:Createdate" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -filecreatedate -filemodifydate -createdate -a -G1 y:\!temp\Test4.jpg
[System]        File Creation Date/Time         : 2014:03:16 09:02:20-07:00
[System]        File Modification Date/Time     : 2014:08:23 11:50:22-07:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20

C:\>exiftool -P -overwrite_original "-FileModifyDate<Exif:Createdate"  y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -filecreatedate -filemodifydate -createdate -a -G1 y:\!temp\Test4.jpg
[System]        File Creation Date/Time         : 2014:03:16 09:02:20-07:00
[System]        File Modification Date/Time     : 2014:03:16 09:02:20-07:00
[ExifIFD]       Create Date                     : 2014:03:16 09:02:20
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ghelfrich919


Phil Harvey

Hi Gerry,

I'm almost out of ideas.  That ExifTool version should work when writing FileCreateDate.  One thing left:  Are there any Unicode characters in the directory or file name?  This could potentially be a difference.

Also, what version of Windows, and what command shell (cmd.exe?).

- 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 ($).

ghelfrich919

Ok, I have been able to run a few more tests to further isolate the behavior/issue when trying to update FileCreateDate/FileModify Date on windows.

When using the tool, I typically use universal naming conventions to represent the directory/path for the source file(s).  I don't generally map network drives to remotely access folders on a windows computer using its drive letter, and instead access them using a UNC path for convenience.

For example:  Exiftool "-FileCreateDate<Exif:Createdate" \\host-name\share-name\file_path

So last evening, I reran a couple of test to see what effect using UNC had on the results.  The following are the tests I ran and the results.

<6A> Ran : Exiftool "-FileCreateDate<Exif:Createdate" file   <-- using a mapped drive
for example: Exiftool "-FileCreateDate<Exif:Createdate" z:\file_path\file
Output:
    1 image files updated

<6B> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
for example: Exiftool -filecreatedate -filemodifydate -createdate -a -G1 z:\file_path\file
Output:
[System]        File Creation Date/Time         : 2021:02:28 00:59:03-05:00
[System]        File Modification Date/Time     : 2021:02:28 00:59:03-05:00
[ExifIFD]       Create Date                     : 2014:03:27 23:32:47


<7A> Ran : Exiftool "-FileCreateDate<Exif:Createdate" file   <-- using local c:\ drive
for example: Exiftool "-FileCreateDate<Exif:Createdate" c:\file_path\file
Output:
    1 image files updated

<7B> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
for example: Exiftool -filecreatedate -filemodifydate -createdate -a -G1 c:\file_path\file
Output:
[System]        File Creation Date/Time         : 2014:03:27 23:32:47-04:00
[System]        File Modification Date/Time     : 2021:02:28 00:59:03-05:00
[ExifIFD]       Create Date                     : 2014:03:27 23:32:47

So, as you can see from the tests above, and the tests I ran in my initial note, I have encountered the following results when trying to update FileCreateDate from Exif:CreateDate on windows:

     1 - using universal naming convention for file path (initial tests <2>,<3>) - FileCreatedate does NOT update
     2 - using a mapped drive for the file path  (tests <6a>,<6B> above)         - FileCreatedate does NOT update
     3 - using local c: drive for the file path  (tests <7a>,<7B> above)         - FileCreatedate DOES update


I also re-ran test <4> and <5> from my initial set of tests for the same 2 additional conditions above with the results as follows:

<8A> Ran : Exiftool "-FileModifyDate<Exif:Createdate" file   <-- using a mapped drive
for example: Exiftool "-FileModifyDate<Exif:Createdate" z:\file_path\file
Output:
    1 image files updated

<8B> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
for example: Exiftool -filecreatedate -filemodifydate -createdate -a -G1 z:\file_path\file
Output:
[System]        File Creation Date/Time         : 2014:03:27 23:32:47-04:00
[System]        File Modification Date/Time     : 2014:03:27 23:32:47-04:00
[ExifIFD]       Create Date                     : 2014:03:27 23:32:47

<9A> Ran : Exiftool "-FileModifyDate<Exif:Createdate" file   <-- using local c:\ drive
for example: Exiftool "-FileModifyDate<Exif:Createdate" c:\file_path\file
Output:
    1 image files updated

<9B> Ran : exiftool -filecreatedate -filemodifydate -createdate -a -G1 FILE
for example: Exiftool -filecreatedate -filemodifydate -createdate -a -G1 c:\file_path\file
Output:
[System]        File Creation Date/Time         : 2021:02:28 12:37:09-05:00
[System]        File Modification Date/Time     : 2014:03:27 23:32:47-04:00
[ExifIFD]       Create Date                     : 2014:03:27 23:32:47

So, as you can see from the above set of tests, along and the tests ran (<4> & <5>) in my initial note, I have encountered the following results when trying to update FileModifyDate from Exif:CreateDate on windows:

     1 - using universal naming convention for file path (initial tests <4>,<5>) - BOTH FileModifydate & FileCreateDate are updated
     2 - using a mapped drive for the file path  (tests <8a>,<8B> above)         - BOTH FileModifydate & FileCreateDate are updated
     3 - using local c: drive for the file path  (tests <9a>,<9B> above)         - ONLY FileModifydate is updated


So it would appear from these series of tests when trying to update FileCreateDate & FileModifyDate on windows (only win10 tested), they are only updated correctly on local drives, and not when using UNC or mapped drives.

Unfortunately, I won't be able to update FilecreateDate & FileModifyDate for my image files as I had intended from what I have learned here since there are all saved on shared drives.  I hope this information helps.

Gerry

Phil Harvey

Hi Gerry,

Thanks.  There have been other problems too with shared drives.  I don't see why this should be different from any other drives, but apparently in Windows it is, at least when calling the Windows KERNEL32 SetFileTime, which is how ExifTool sets FileCreateDate on Windows.  This isn't something that I am inclined to pursue (if I spent time working on all the Windows quirks the ExifTool development would grind to a halt).

- 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 ($).