Command ERASE Foundation
Deletes a file from a hard disk or diskette.
ERASE <cFileName> | DELETE FILE <cFileName>
The file command ERASE deletes a file from hard disk or diskette. DELETE FILE can be used instead of ERASE. Both commands delete a file. The file is only deleted if <cFilename> is a valid file name. Failure of the deletion operation can be detected by the error code returned from the function FError().
The command does not consider either the setting set with PATH or the path specified with DEFAULT. <cFilename> must be a complete file name, including drive and path. If no drive or path is contained in <cFilename>, ERASE searches for the file in the current path.
The function FErase() is the functional equivalent of the command ERASE.
Under OS/2, the deleted file can be recovered using the UNDELETE command when the environment variable SET DELDIR= is defined in CONFIG.SYS.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.