# File_DelFile

> Deletes a file, optionally forcing the deletion when the file is locked.

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

### Description

Deletes specified file

### Syntax

File_DelFile(sFile, bForce) As Boolean

### Parameters

#### sFile (String)

File to remove

#### bForce (Boolean)

Ignore if file is locked

### Example

**VBScript**

```vb
If bStatus then bStatus = File_DelFile("C:\CapaInstaller.txt", True)
```

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

### Related functions

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