Syntax for blanking DateTimeOriginal field

Started by bretorourke, March 01, 2023, 01:04:35 PM

Previous topic - Next topic

bretorourke

Hi, could someone please help me with the command line syntax to blank the DateTimeOriginal (aka Date Taken) field for all JPG files in a directory?

Thank you

StarGeek

You would use
exiftool -DateTimeOriginal= /path/to/files/

But if by "Date Taken", you're referring to the name in Windows Property->Details, then removing DateTimeOriginal isn't enough because there are 6 different tags that Windows will read to fill the "Date Taken" property (see this post).

A more complete command would be
exiftool -AllDates= /path/to/files/
* 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).

bretorourke

Perfect thank you!  Yes indeed I was referring to the Date Taken field in Windows. 

One more request... what would be the syntax to write the "Date Taken" field in Windows?  My goal is to use a single field, ideally visible in Windows, that represents the date that the camera took the picture.

Thank you

StarGeek

You would set one or more of the 6 tags (see the link above) to the correct value or set the shortcut I listed to set three at once.

exiftool -AllDates="2023:03:02 12:00:00" /path/to/files/
* 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).

bretorourke

Thank you.  Hopefully one last dumb question.  When I run:

exiftool -DateTimeOriginal= /Temp2

Where Temp2 is a sub-dir in the folder where the EXE is located, and Temp2 has JPG files in the directory, I get an error that no images were updated due to files not being found.  I tried /Temp2/*.* but no luck.  What syntax am I missing?

Thank you again for your kind replies.

StarGeek

Quote from: bretorourke on March 04, 2023, 01:32:16 PMWhere Temp2 is a sub-dir in the folder where the EXE is located, and Temp2 has JPG files in the directory

Is it a direct subdirectory of your Current Directory? What is your exact command and the exact output?

You either need to provide the proper path to the directory you want and if you are trying to recurse into subdirectories, then you need to add the -r (-recurse) option.  Read that option and Common Mistake #2 with regards to wildcards and recursing.
* 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).

Phil Harvey

The easiest thing to do is drag and drop the folder onto the terminal window instead of typing its name.

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