1

I need to get the REAL creation date of image or video files within a Windows Script.

I have copied many image and video files from my iPhone device. The problem is the information of file about creation and modified date is related to the copying of these files in my computer, and not the real creation date.

This is my script:

@ ECHO OFF
FOR %%F IN (*.jpg *.heic *.png) DO (
    SET "DATEFILEIMAGE=%%~tF"
    FOR /f "tokens=1,2,3,4 delims=/ " %%a in ("%%~tF") do (
        MKDIR %%c.%%b
        MOVE "%%F" %%c.%%b
    )
)

This works fine, but the date from file is not the REAL creation date.

If I open the file with mediainfo I can get the REAL creation date of image or video. But can I use the CLI of MediaInfo to get ONLY this information and use it inside my script?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Klode
  • 353
  • 3
  • 18
  • I'm sure it's possible, but in answer to your question, I am unwilling to judge your ability to use the CLI of MediaInfo to get it. – Compo Aug 25 '19 at 22:16

1 Answers1

0

But can I use the CLI of MediaInfo to get ONLY this information

@ ECHO OFF
FOR %%F IN (*.mp4) DO (
    MediaInfo --Inform="General;%%Encoded_Date%%" %%F > tmpFile
    set /p EncodedDate= < tmpFile
    del tmpFile
    echo %EncodedDate%
    )
)

I used MP4 files for my tests because I have doubts that you find real creation dates of *.jpg *.heic *.png with MediaInfo (actually I have doubts this metadata is in the file).
if you see the information you are looking for with MediaInfo, use "MediaInfo --Language=raw %YourFileName%" for seeing the field name to use instead of "Encoded_Date" in my example.

Jérôme Martinez
  • 1,118
  • 5
  • 10