The UNDELETE utility recovers files that have been deleted or erased. When the DEL or ERASE command is issued from any session type, the file is moved to a specified hidden directory, along with details of where the file originated. If no space is available, the oldest files are automatically purged to provide more space.
The DELDIR environment variable is used to specify the name and maximum size of the directories where files targeted for deletion are to be stored. Normally this will be set in CONFIG.SYS, and takes the form:
SET DELDIR = drive:\path, maxsize [;drive:\path, maxsize]
The string is composed of a directory path specifier and maximum size value for each supported logical drive. These parameters are separated by commas. The definitions for each drive are separated by semicolons.
The path portion of the string consists of a drive letter and the fully qualified path of the directory that will be used for storing deleted files.
The maxsize portion of the string defines the maximum size of the storage directory, in kilobytes.
In order to keep track of deleted files, the system also maintains a control file in each storage directory.
When UNDELETE is specified and the file is still recoverable, it is restored to its specified path. If the file already exists, the user is prompted to rename the file, or to skip the current entry.
Space occupied by recoverable files is included in DIR and CHKDSK output reports.
The format of the UNDELETE command is :
undelete <filename> [/list | /all] [/s] [/force]
re:
<filename>
UNDELETE runs in both protect mode and in a DOS VDM.