In tips 0494, 3579, 3580, and 6933, I parsed a file batch parameter.
The %~t1 syntax will return the date and time that file %1 was modified.
I have scripted GetDTTM.bat to return a call directed environment variable with the date and time that file %1 was modified.
The syntax for using GetDTTM.bat is:
Call GetDTTM.bat FileName DTTM
Where FileName is the fully qualified name of a file, and DTTM is the name of the variable you want set.
GetDTTM.bat contains:
@echo off if \{%2\}==\{\} @echo Syntax: Call GetDTTM FileName DTTM&goto :EOF set %2= if not exist %1 @echo File %1 not found.&goto :EOF set %2=%~t1
0 comments
Hide comments