The following example illustrates the use of the
GetFileVersion method.
JScript
function GetVersion(drivespec){
var fso, s = "";
fso = new ActiveXObject("Scripting.FileSystemObject");
s += fso.GetFileVersion(drivespec);
return(s);
}
VBScript
Function GetVersion(DriveSpec)
Dim fso, temp
Set fso = CreateObject("Scripting.FileSystemObject")
temp = fso.GetFileVersion(DriveSpec)
If Len(temp) Then
GetVersion = temp
Else
GetVersion = "No version information available."
End If
End Function
PowerBASIC
FUNCTION GetVersion (BYVAL DriveSpec AS STRING) AS STRING
LOCAL fso AS IFileSystem3
LOCAL temp AS STRING
fso = NEWCOM "Scripting.FileSystemObject"
temp = ACODE$(fso.GetFileVersion(UCODE$(DriveSpec)))
IF LEN(temp) THEN
FUNCTION = temp
ELSE
FUNCTION = "No version information available."
END IF
END FUNCTION