# File_GetVersion

> Returns the version of the specified file.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/file-functions/file-getversion/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

#### Description

Returns the version of the specified file

### Syntax

File_GetVersion(sFile, bMustExist) As Boolean

### Parameters

#### sFile (String)

Filename

#### bMustExist (Boolean)

File must exist

#### 

### Return value

Result will be stored in gsValue. Function will return false if file does not exist and bMustExist is true

### Example

**VBScript**

```vb
If bStatus Then bStatus = File_GetVersion(gsProgramFiles & "\CapaInstaller\Agent\CIAgent.exe", True)
If bStatus Then bStatus = Job_Writelog("Custom", "Current version of CIAgent.exe is : " & gsValue, bStatus, True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[File_GetFileDateCreated](/capainstaller/vb-scripting-library/file-functions/file-getfiledatecreated/) File_GetSecurity [File_GetShortPath](/capainstaller/vb-scripting-library/file-functions/file-getshortpath/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
