Kill

Syntax

Kill FileSpec$

Remarks

Deletes the specified file or files. If FileSpec$ specifies an open document, an error occurs.

Argument

Explanation

FileSpec$

The file specification. In Windows, you can use the MS-DOS wildcard characters — the asterisk (*) and the question mark (?) — to specify files. You can also specify a path as part of the file specification (for example, C:\DOCS\*.TXT).

On the Macintosh, you can use MacID$() to specify files of a certain type (for example, MacID$("TEXT")); to specify a path, precede the Kill instruction with a ChDir instruction.


Examples

This example deletes a file in C:\WORD\ LETTERS. On the Macintosh, substitute a path and filename such as HD:WORD:LETTERS:DRAFT.


Kill "C:\WORD\LETTERS\DRAFT.DOC"

The following Windows example deletes all the files in the C:\DELETE folder:


Kill "C:\DELETE\*.*"

The previous example could be rewritten for the Macintosh as follows:


ChDir "HD:DELETE"
Kill MacID$("****")

See Also

CopyFile, MacID$(), RmDir