# File_ExistFile

> Check for file existence.

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

### Description

Check for file existence

### Syntax

File_ExistFile(sFile, bMustExist) As Boolean

### Parameters

#### sFile (String)

Filename

#### bMustExist (Boolean)

File must exist

#### 

### Return value

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

### Example

**VBScript**

```vb
If bStatus Then bStatus = File_ExistFile("C:\CapaInstaller.txt", False)
If bStatus Then bStatus = Job_Writelog("Custom", "gbValue: " & gbValue, bStatus, True) 
```

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

### Related functions

[File_CreateEmptyFile](/capainstaller/vb-scripting-library/file-functions/file-createemptyfile/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
