Kill Statement

Description

Deletes files from a disk.

Syntax

Kill pathname

The pathname argument is a string expression that specifies one or more filenames to be deleted. The pathname may include the directory or folder, and the drive.

Remarks

In Microsoft Windows, Kill supports the use of * (multiple character) and ? (single character) wildcards to specify multiple files.

An error also occurs if you try to use Kill to delete an open file.

To delete directories, use the RmDir statement.

See Also

RmDir Statement.

Example

This example uses the Kill statement to delete a file from a disk.


' Assume TESTFILE is a file containing some data."TestFile"    ' Delete file.
' In Microsoft Windows:
' Delete all *.TXT files in current directory."*.TXT"