С пакетным файлом вы можете сделать что-то вроде этого:
@echo off
Title Get file modification date in 24 hour format using windows batch file
set "DesktopFolder=%userprofile%\Desktop"
set "Ext=txt"
CD /D "%DesktopFolder%"
Setlocal EnableDelayedExpansion
@FOR /F "delims=" %%A IN ('dir /B "%DesktopFolder%\*.%Ext%" 2^>nul') DO (
SET /a "Count+=1"
SET "File[!Count!]=%%~fA"
)
@For /L %%i in (1,1,%Count%) do (
Call :GetLastModifiedDate "!File[%%i]!" LastModifiedDate
echo "!File[%%i]!" "!LastModifiedDate!"
)
Pause & EXIT
::----------------------------------------------------------------------------
:GetLastModifiedDate <File> <LastModifiedDate>
Set "vbsfile=%Temp%\%~n0.vbs"
>"%vbsfile%" (
echo Set FSO=CreateObject("Scripting.FileSystemObject"^)
echo WScript.Echo FSO.GetFile("%~1"^).DateLastModified
)
@for /f "delims=" %%a in ('cscript //NoLogo "%vbsfile%"') do Set "%2=%%a"
Exit /B
::----------------------------------------------------------------------------