Developer(s) | Microsoft,Datalight, Charles Dye |
---|---|
Initial release | March 1993; 32 years ago (1993-03) |
Operating system | MS-DOS 6,SpartaDOS X,ROM-DOS,FreeDOS,Windows 9x |
Type | Command |
License | MS-DOS, ROM-DOS, Windows:Proprietarycommercial software FreeDOS:GPL v2 |
Incomputing,DELTREE
(short fordelete tree) is acommand linecommand in someMicrosoftoperating systems,SpartaDOS X[1] andFreeDOS[2] that recursively deletes an entire subdirectory of files.
WhenIBM and Microsoft introducedPC DOS 1.0 andMS-DOS 1.0, subdirectories were not yet supported. This state of affairs was remedied with the release of DOS 2.0, which introduced support for subdirectories and directory nesting; however, it had no built-in facility for deleting entire subdirectory trees.[3] Through the release of MS-DOS 5.0, removing nested subdirectories required removing all of the files in the lowest subdirectories, then removing the subdirectory itself, then repeating the process up the directory tree. By 1991 at least one competing product,DR-DOS, had introduced a well-received utility that enabled recursive file deletion.[4] With the introduction of MS-DOS 6.0, Microsoft regained parity by adding theDELTREE
command.[5]
DELTREE
was retained inWindows 9x but was not shipped inWindows NT family of operating systems. Instead, thermdir
(aliasrd
) command removes a subdirectory along with all its files if the/S
command-line switch is given.[6]
In MS-DOS, PC DOS and Windows 9x,DELTREE
was implemented as an external command, with its functionality kept in a separate file outside ofCOMMAND.COM.[7] Normal operation prompted the user for verification that the specified directories were indeed intended to be removed, but this safeguard could be suppressed with a command-line option.[5] Unlike most other commands that operated on the file system, multiple directories could be passed to the command at one time.[8] An undocumented feature allowed the user to append a trailing "/" character to a directory name in order to preserve the directory but remove everything underneath it.[9] In theory, deleted material could be recovered.[8]
DatalightROM-DOS[10] also includes an implementation of theDELTREE
command.
TheFreeDOS version was developed by Charles Dye and is licensed under theGPL v2.[11]
The command-syntax is:
DELTREE[/Y][DRIVE:][PATH]
DELTREE
was designed to ignore all file and directory attributes, such ashidden,read-only andsystem.[9] The command was described as "potentially dangerous" and "capable of wiping out hundreds of files at a time".[5] Combined with the PURGE command (which prevented data recovery), it became an example of a worst-case payload formalware[12] as well as figuring in one of the early computer sabotage trials.[13][14]
Contributing to the problem is the fact that MS-DOS and Windows 9x do not supportdiscretionary access control to mitigate this issue. The Windows NT family does. Furthermore, starting withWindows Vista,mandatory access control andUser Account Control further mitigate the issue.