Reputation: 69
Tell me how you can find out the date the file was created in BAT. We have a variable for %%~ti, but it only indicates the file's modification date. And how do you know it is the date the file was created?
Upvotes: 1
Views: 3938
Reputation: 2710
@echo off
for /f "skip=5 tokens=1,2 delims= " %%a in ('dir /a-d /tc "%~1"') do (
echo Date: %%a, Time: %%b, File: %~1
exit /b 0
)
Upvotes: 1
Reputation: 41234
At least these three options exist, which are all scriptable.
There can be limitations depending on the OS version, and the language, and characters being used.
Upvotes: 0