Microsoft® JScript®
GetFileVersion Method
 Scripting Run-Time Reference 
 Version 5 

See Also                  Applies To

Returns the version number of a specified file.

The GetFileVersion method syntax has these parts:

Part Description
object Required. Always the name of a FileSystemObject.
pathspec 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 file or if the file does not contain version information.

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 ShowFileVersion(pathspec)
  var fso, s = "";
  fso = new ActiveXObject("Scripting.FileSystemObject");
  s += fso.GetFileVersion(pathspec);
  if (s == "")
    s = "No version information available.";