GetFileVersion Method

 

Description

 

Returns a TextStream object corresponding to the standard input, output, or error stream.

 

PowerBASIC Syntax

 

METHOD GetFileVersion ( _

BYVAL bstrFileName AS STRING _

) AS STRING

 

Arguments

 

bstrFileName

BSTR. The path (absolute or relative) to a specific file.

 

Remarks

 

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.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem3

DIM strVersion AS STRING

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get the file version

strVersion = fso.GetFileVersion(UCODE$("C:\MyFolder\MDAC Version 2.8.doc"))

IF LEN(strFileVersion) THEN

  MSGBOX "File version: " & ACODE$(strVersion)

ELSE

  MSGBOX "No version information available"

END IF

 

Valid XHTML 1.0 Transitional