GetFileSize

Top  Previous  Next

 

The GetFileSize Special Function Command allows you to retrieve the Size number 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]

 

The comma character after the command is compulsory as is the file name parameter.

 

Parameters:

 

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

 

The parameter is compulsory. If any required parameter is missing or invalid an error will be thrown. The 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, so that 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 size of the installed copy of Windows Media Player

 

Var:MediaPlayerSize=GetFileSize,"C:\Program Files (x86)\Windows Media Player\wmplayer.exe"

 

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