Previous Topic: Read and Compare File VersionsNext Topic: CompareVersions


GetFileInfo

The GetFileInfo function reads the file information of a given file. You can use the retrieved file information in other functions such as CompareVersions.

This function has the following format:

GetFileInfo (option as string, filename as string, result as string) as boolean

Example: GetFileInfo

getfileinfo("version","dmscript.exe",version)

Input Parameters

This function has the following input parameters:

Option

Specifies the file information you want to retrieve. You can specify one of the following options:

"version"

Retrieves the complete file version string in the format major.minor.patch.build. Example: "12.5.0.1234"

"major"

Retrieves the major version number of the file.

"minor"

Retrieves the minor version number of the file.

"patch"

Retrieves the patch number of the file.

"build"

Retrieves the build number of the file.

"desc"

Retrieves the file description (Windows only).

"ext"

Retrieves the file extension.

"filename"

Retrieves the file name from a path name without the extension.

Result

Specifies a string variable that holds the result returned by the function.

Return Values

If the function is able to retrieve the file information, it returns true.