Scripting Runtime Library  

GetFileVersion Method

Returns the version number of a specified file.



Required. Always the name of a FileSystemObject.
Required. The path (absolute or relative) to a specific file.


The GetFileVersion method returns a zero-length string ("") if pathspec does not end with the named component.

Note   The GetFileVersion method works only on the provided path string. It does not attempt to resolve the path, nor does it check for the existence of the specified path.

The following example illustrates the use of the GetFileVersion method.

function ShowFileName(filespec){
   var fso, s = "";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   s += fso.GetFileVersion(filespec);
Function GetVersion(DriveSpec)
   Dim fso, temp
   Set fso = CreateObject("Scripting.FileSystemObject")
   temp = fso.GetFileVersion(pathspec)
   If Len(temp) Then
      GetVersion = temp
      GetVersion = "No version information available."
   End If
End Function

See Also

GetAbsolutePathName Method | GetBaseName Method | GetDrive Method | GetDriveName Method | GetExtensionName Method | GetFile Method | GetFileName Method | GetFolder Method | GetParentFolderName Method | GetSpecialFolder Method | GetTempName Method
Applies To: FileSystemObject Object