• Welcome to Jose's Read Only Forum 2023.
 

IFileSystem3.GetFileVersion Method

Started by José Roca, July 14, 2008, 02:11:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



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