ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Wind on August 14, 2018, 04:22:15 AM

Title: set the creation and modification date for folders
Post by: Wind on August 14, 2018, 04:22:15 AM
Hi,

I have video files with the following naming rule :
YYYYMMDD_hhmmss.mp4
Example :
20180728_073833.mp4 (recorded on 28/072018 7:38:33)
On Windows OS, I am successfully able to set the FileCreateDate and FileModifyDate, using the filename, with the following command :
exiftool(-k).exe "-FilecreateDate<${Filename}" "-FileModifyDate<${Filename}" -recurse -ext mp4 DIR


I also have folders with a similar naming rule :
YYYYMMDD_folder1
YYYYMMDD_folder2
etc...

Two years ago, I found a way to set the creation and modification date of these folders using the timestamp in the name, in the same way as above. I am pretty sure I did that with exiftool, but now can't figure out how I did that and which argument should be passed to the command line. Any idea ?
Title: Re: set the creation and modification date for folders
Post by: Phil Harvey on August 14, 2018, 07:37:32 AM
The command to set the file modification and creation date from the file name is:

exiftool "-filemodifydate<filename" "-filecreatedate<filename" DIR

- Phil
Title: Re: set the creation and modification date for folders
Post by: Wind on August 14, 2018, 08:09:08 AM
Thx Phil for your prompt answer, this is what I use for files and it works great. My question is related to the folder itself, not its content.
As an example, I have created today (August 14th) 2 empty folders, named :
20180701 - folder1
20180702 - folder2

I need to set the creation date of these folders to July 1st and July 2nd respectively.
Using the syntax you suggest does not have any effect on the folder creation date, I just get the following output


FileName encoding not specified.  Use "-charset FileName=CHARSET"
    2 directories scanned
    0 image files read
-- press RETURN --
Title: Re: set the creation and modification date for folders
Post by: Phil Harvey on August 14, 2018, 08:14:34 AM
ExifTool can not set the attributes of a folder.

- Phil