set the creation and modification date for folders

Started by Wind, August 14, 2018, 04:22:15 AM

Previous topic - Next topic

Wind

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 ?

Phil Harvey

The command to set the file modification and creation date from the file name is:

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

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

Wind

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 --

Phil Harvey

ExifTool can not set the attributes of a folder.

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