DeleteFile

Deletes a file.

Member of namespace

FileIO

Syntax

bool DeleteFile (string filename)

Parameters

filename
Type: string

Parameters:

filename: The name and path of the file to delete. Smart parameters are supported.

Returns

Always True.

Level

All levels.

Details

Deletes the specified file. DOS wildcards are permitted in the file name.
Example

The following example deletes the specific file.

DeleteFile("C:\Temp\DeleteThis.txt")

The following example deletes all of the files in the Temp directory.

DeleteFile("C:\Temp\*.*")

The following example deletes the file name that matches the current batch ID and has an extension of TXT.

DeleteFile("C:\Temp\@BATCHID+.txt")