---
title: "Delete Files"
description: "The Invantive Script statement that deletes files matching a pattern."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-script/statements/delete-files
original: https://documentation.invantive.eu/en/docs/invantive-script/statements/delete-files
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

# Syntax
Files can be deleted using the syntax:
```
local delete files "SPECIFICATION"
```
The specification can contain a directory path. When no directory path is specified, the current working directory is used. The specification must contain a file pattern with the following special characters:
- `*`: sequence of any 0, 1 or more characters.
- `?`: any character.

# Examples
The following example deletes the file `c:\temp\temp.bin` when existing:
```
local delete files "c:\temp\temp.bin"
```
The following example deletes all files with a name starting with `temp` and extension `.bin` in `c:\temp`:
```
local delete files "c:\temp\temp*.bin"
```