GetFileDate

Top  Previous  Next

 

The GetFileDate Special Function Command allows you to retrieve the date of the specified file formatted as a string.

lamp Important: Special Function commands can only be used on the right hand side of a Variable Assignment command.

Command Syntax

 

GetFileSize,[FullyQualifiedFileName],[DateType]

 

The comma character after the command is compulsory as are the file name and date type parameters.

 

Parameters:

 

TargetFileName: The fully qualified path and file name of the file from which to retrieve the Date information.

DateType: A string representing a valid member of the FileDateType enumeration, currently one of the following values: CreationDate, LastAccessDate, LastModifiedDate

 

All parameters are compulsory. If any required parameter is missing or invalid an error will be thrown. The TargetFileName parameter must be surrounded by quotation marks if one or more spaces are included in the path and file name. It is good practice to include the quotation marks in any case, as it reduces the risk of error when writing scripts.

lamp Important: The target file MUST already exist before the script is run.

Example:

 

Retrieve the last modified date of the installed copy of Windows Media Player

 

Var:MediaPlayerDate=GetFileDate,"C:\Program Files (x86)\Windows Media Player\wmplayer.exe",LastModifiedDate

 

See Also: Special Functions GetBuildFileVersion GetFileNameVersion GetFileSize GetMajorFileVersion GetMinorFileVersion GetRevisionFileVersion GetRegistryValue IncrementFileVersion