undelete(CMD) 19 June 1992 undelete(CMD) Name undelete - restore files previously deleted with the Del command Syntax undelete [[drive:][path]filename] [/list|/all] [/dos|/dt] Parameter [drive:][path]filename Specifies the location and name of the file or set of files you want to recover. By default, undelete restores all deleted files in the current directory. Switches /list Lists the deleted files that are available to be recovered, but does not recover any files. The [drive:][path]filename] parameter and the /dt and /dos switches control the listing pro- duced by this switch. /all Recovers deleted files without prompting for confirmation on each file. undelete uses the deletion-tracking file if it is present. Otherwise, undelete recovers files from the DOS directory, sup- plying a number sign (#) for the missing first character in the filename. If a duplicate filename already exists, this switch next tries each of the following characters, in the order listed, until the result is a unique filename: #%&-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ. /dos Recovers only those files that are internally listed as deleted by MS-DOS, prompting for confirmation on each file. If a deletion-tracking file exists, this switch causes undelete to ignore it. /dt Recovers only those files listed in the deletion-tracking file produced by the mirror command, prompting for confirmation on each file. For more information about deletion-tracking files, see the mirror(CMD) command. Note Use any one of the following switches: /dos, /dt, or /all. If you do not specify a switch, undelete uses the deletion-tracking file, if it is available. If the deletion-tracking file is not available, undelete attempts to recover files by using the directory listing of deleted files. Recovering deleted files by using the deletion-tracking file is usually more reliable than doing so by using the directory listing of deleted files. _________________________________________________________________________ CAUTION undelete cannot restore a directory that has been removed, and it cannot retrieve a file if you have removed the directory that contained the file. If the directory was an immediate sub- directory of the root directory, you may be able to retrieve the directory and its files if you first use the unformat command described later in this chapter to restore the directory and then use undelete to retrieve the files. You must use caution because you can lose data if you use unformat incorrectly. Usually unfor- mat can restore only immediate subdirectories of the root direc- tory. However, when you use unformat to recover an accidentally formatted disk, unformat recovers all root-level files and sub- directory names. _________________________________________________________________________ Examples The following command specifies that undelete is to recover all deleted files in the current directory one at a time and to prompt for confirma- tion on each file: undelete The following command specifies that undelete is to recover all deleted files with the .BAT extension in the root directory of drive C, without prompting for confirmation on each file: undelete c:\*.bat /all _________________________________________________________________________ CAUTION Once you delete a file from your disk, you may not be able retrieve it. Although the undelete command can recover deleted files, it can do so with certainty only if no other files have been created or changed on the disk. If you accidentally delete a file that you want to keep, stop what you are doing and immediately use the undelete command to retrieve the file. _________________________________________________________________________