Answer the question
In order to leave comments, you need to log in
How to bulk change the modification date of files (based on the name)?
Mighty minds, please advise, how can a hundred files like IMG_20170601-125533.jpg change the DATE OF CHANGE or CREATION of a file according to the model name?
Let me explain - I merged photos from the android phone, ran them through iCatalyst to slightly reduce the size, and when I uploaded it back, all the galleries that sort by change time (or whatever it is by default in android) do not show the chronology correctly.
Answer the question
In order to leave comments, you need to log in
The question about metadata led me to the solution: jhead .
Namely jhead -ft *.jpg
My advice to you, hammer in Yandex: powershell change date file creation
Perhaps the renamer program will help you too, but this is not accurate.
By standard means, the file date/time can only be changed with a JS/VBS/PoSh script.
You can use, for example, this utility or touch ported from Linux (available in msys2/mingw).
To extract the date/time from the name, use this script:
@echo off
setlocal enabledelayedexpansion
set "filemask=.\*.jpg"
for /f "tokens=* delims=" %%a in ('dir /b "%filemask%" ') do (
set "file=%%~na"
set "YEAR=!file:~4,4!"
set "MONTH=!file:~8,2!"
set "DAY=!file:~10,2!"
set "HH=!file:~13,2!"
set "MM=!file:~15,2!"
set "SS=!file:~17,2!"
echo.!YEAR! !MONTH! !DAY! !HH! !MM! !SS!
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question