8.5.21 GetVersionInfo or GetVerInfo (get version information for a file)
- Purpose
-
Gets version information for a file.
- Syntax
GetVersionInfo (PathName, [Version1Buff], [Version2Buff], [DescriptionBuff], [LegalCopyrightBuff], [CompanyNameBuff], [OriginalFilenameBuff], [ProductVersionBuff], [ProductNameBuff] [, InternalNameBuff]) GetVerInfo (PathName, [Version1Buff], [Version2Buff], [DescriptionBuff], [LegalCopyrightBuff], [CompanyNameBuff], [OriginalFilenameBuff], [ProductVersionBuff], [ProductNameBuff] [, InternalNameBuff])
- Arguments
-
- PathName
-
Write the full path of the file as a character string or as a variable that stores this value.
- Version1Buff
-
Specify a variable for storing the file version in the form 9999.9999.9999.9999. Omit this argument if not required.
The file version is returned as a character string in 9999.9999.9999.9999 form, where 9999 is a four-digit numerical string padded with leading zeros.
- Version2Buff
-
Specify a variable for storing the file version. Omit this argument if not required.
The file version is returned as a string.
- DescriptionBuff
-
Specify a variable for storing the description. Omit this argument if not required.
- LegalCopyrightBuff
-
Specify a variable for storing the copyright. Omit this argument if not required.
- CompanyNameBuff
-
Specify a variable for storing the company name. Omit this argument if not required.
- OriginalFilenameBuff
-
Specify a variable for storing the original file name. Omit this argument if not required.
- ProductVersionBuff
-
Specify a variable for storing the product version. Omit this argument if not required.
- ProductNameBuff
-
Specify a variable for storing the product name. Omit this argument if not required.
- InternalNameBuff
-
Specify a variable for storing the internal name. Omit this argument if not required.
- Description
-
The GetVersionInfo or GetVerInfo command gets version information for the specified file and stores each item of information in the buffer variables. The command returns True on successful execution, or False if an error occurs.
- Note
-
Take care when specifying a file in the folder set in the environment variable ProgramFiles (normally the Program Files folder on the system drive) or WinDir (normally the Windows folder on the system drive). For details, see 1.8.2 Command behavior.
- Example
' Compare file versions. Dim path1, ver1, ver2 path1 = "C:\Program Files\Hitachi\Script\Bin\SPTXE.EXE" ver0520 = "0005.0020.0000.0000" GetVersionInfo (path1, ver1, ver2) If ver0520 < ver1 Then MessageBox ("File is later than" + ver0520 + _NL_ + _ "file version:" + ver2) End If
- JP1/Script version
-
Supported from JP1/Script 06-00.