Kill Statement

Deletes files from the disk.

Syntax

Kill pathname

The required pathname argument is a string, specifying the names of one or more files to be deleted. The pathname argument may include names of directory/folder, or a drive name.

Remarks

An attempt to delete an open file with the Kill statement generates an error.

Note: Use the RmDir statement to delete directories or folders.

Example

In this example the Kill statement is used to delete a file from disk.

' Assume the TESTFILE file exists and is not empty.
Kill "TestFile"   'Deletes the file.

See Also

RmDir Statement