@echo off
echo Before:
for %%A in (*.jpg) do (
for /f "tokens=1-2 delims=" %%i in ('"forfiles /m "%%A" /c "cmd /c echo @fdate @ftime" "') do echo %%i %%j %%A
)
echo Changing dates...
for %%A in (*.jpg) do (
echo Redating %%A
copy /b "%%A"+,, > nul
ping -n 2 127.0.0.1>nul
)
echo After:
for %%A in (*.jpg) do (
for /f "tokens=1-2 delims=" %%i in ('"forfiles /m "%%A" /c "cmd /c echo @fdate @ftime" "') do echo %%i %%j %%A
)
Saída:
Before:
22/12/2016 21:52:17 img01.jpg
15/04/2017 19:25:39 img02.jpg
26/12/2010 11:00:45 img03.jpg
03/02/2018 20:48:00 img04.jpg
15/07/2018 20:01:14 img05.jpg
29/03/2012 19:28:54 img06.JPG
04/10/2003 16:47:54 img07.jpg
04/08/2006 17:27:25 img08.jpg
Changing dates...
Redating img01.jpg
Redating img02.jpg
Redating img03.jpg
Redating img04.jpg
Redating img05.jpg
Redating img06.JPG
Redating img07.jpg
Redating img08.jpg
After:
14/10/2018 09:25:48 img01.jpg
14/10/2018 09:25:49 img02.jpg
14/10/2018 09:25:50 img03.jpg
14/10/2018 09:25:51 img04.jpg
14/10/2018 09:25:53 img05.jpg
14/10/2018 09:25:54 img06.JPG
14/10/2018 09:25:55 img07.jpg
14/10/2018 09:25:56 img08.jpg