DELTREE

Last updated
DELTREE
Developer(s) Microsoft, Datalight, Charles Dye
Initial releaseMarch 1993;30 years ago (1993-03)
Operating system MS-DOS 6, SpartaDOS X, ROM-DOS, FreeDOS, Windows 9x
Type Command
License MS-DOS, ROM-DOS, Windows: Proprietary commercial software
FreeDOS: GPL v2

In computing, DELTREE (short for delete tree) is a command line command in some Microsoft operating systems, SpartaDOS X [1] and FreeDOS [2] that recursively deletes an entire subdirectory of files.

Contents

Overview

When IBM and Microsoft introduced PC DOS 1.0 and MS-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 the DELTREE command. [5]

DELTREE was retained in Windows 9x but was not shipped in Windows NT family of operating systems. Instead, the rmdir (alias rd) command removes a subdirectory along with all its files if the /S command-line switch is given. [6]

Implementations

In MS-DOS, PC DOS and Windows 9x, DELTREE was implemented as an external command, with its functionality kept in a separate file outside of COMMAND.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]

Datalight ROM-DOS [10] also includes an implementation of the DELTREE command.

The FreeDOS version was developed by Charles Dye and is licensed under the GPL v2. [11]

Syntax

The command-syntax is:

DELTREE[/Y][DRIVE:][PATH]

Use in malware and sabotage

DELTREE was designed to ignore all file and directory attributes, such as hidden, read-only and system. [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 for malware [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 support discretionary access control to mitigate this issue. The Windows NT family does. Furthermore, starting with Windows Vista, mandatory access control and User Account Control further mitigate the issue.

See also

Related Research Articles

<span class="mw-page-title-main">COMMAND.COM</span> Default command line for MS-DOS and Windows 9x

COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot, hence being responsible for setting up the system by running the AUTOEXEC.BAT configuration file, and being the ancestor of all processes.

cd (command) Computer command in various operating systems

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

In computing, rmdir is a command which will remove an empty directory on various operating systems.

fdisk Command line utility of DOS and Microsoft Windows operating systems

fdisk is a command-line utility for disk partitioning. It has been part of DOS, DR FlexOS, IBM OS/2, and early versions of Microsoft Windows, as well as certain ports of FreeBSD, NetBSD, OpenBSD, DragonFly BSD and macOS for compatibility reasons. Windows 2000 and its successors have replaced fdisk with a more advanced tool called diskpart.

<span class="mw-page-title-main">XCOPY</span> Computing command

In computing, XCOPY is a command used on IBM PC DOS, MS-DOS, IBM OS/2, Microsoft Windows, FreeDOS, ReactOS, and related operating systems for copying multiple files or entire directory trees from one directory to another and for copying files across a network.

<span class="mw-page-title-main">MS-DOS Editor</span>

MS-DOS Editor, commonly just called edit or edit.com, is a TUI text editor that comes with MS-DOS 5.0 and later, as well as all "x86" SKUs of Windows, until Windows 11. It supersedes edlin, the standard editor in earlier versions of MS-DOS. In MS-DOS, it was a stub for QBasic running in editor mode. Starting with Windows 95, MS-DOS Editor became a standalone program because QBasic didn't ship with Windows.

<span class="mw-page-title-main">CHKDSK</span> System tool in DOS, OS/2 and Windows

In computing, CHKDSK is a system tool and command in DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and related operating systems. It verifies the file system integrity of a volume and attempts to fix logical file system errors. It is similar to the fsck command in Unix and similar to Microsoft ScanDisk, which co-existed with CHKDSK in Windows 9x and MS-DOS 6.x.

tree (command) Shell command in various operating systems

In computing, tree is a recursive directory listing command or program that produces a depth-indented listing of files. Originating in PC- and MS-DOS, it is found in Digital Research FlexOS, IBM/Toshiba 4690 OS, PTS-DOS, FreeDOS, IBM OS/2, Microsoft Windows, and ReactOS. A version for Unix and Unix-like systems is also available.

<span class="mw-page-title-main">ATTRIB</span>

In computing, ATTRIB is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.

del (command) Command in various operating systems

In computing, del is a command in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

help (command) Command in various command line shells

In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, Bash, qshell, 4DOS/4NT, Windows PowerShell, Singularity shell, Python, MATLAB and GNU Octave. It provides online information about available commands and the shell environment.

copy (command)

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.

format (command)

In computing, format, a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.

choice (command)

In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.

In computing, recover is a primitive file system error recovery utility included in MS-DOS / IBM PC DOS versions prior to DOS 6.0 and a number of other operating systems.

In computing, diskcomp is a command used for comparing the complete contents of a floppy disk to another one.

The command-line tool exe2bin is a post-compilation utility program available on MS-DOS and other operating systems.

<span class="mw-page-title-main">MS-DOS 7</span> Computer operating system

MS-DOS 7 is a real mode operating system for IBM PC compatibles. Unlike earlier versions of MS-DOS, it was not released separately by Microsoft, but included in the Windows 9x family of operating systems. Windows 95 RTM report it as MS-DOS 7.0, and Windows 95 OSR 2.x and Windows 98 report as 7.1. The real-mode MS-DOS 7.x is contained in the IO.SYS file.

References

  1. "SpartaDOS X 4.48 User Guide" (PDF). Archived (PDF) from the original on 2021-10-10. Retrieved 2019-03-16.
  2. "The FreeDOS Project blog: FreeDOS commands quick-reference". 29 June 2018. Archived from the original on 22 July 2018. Retrieved 22 July 2018.
  3. Dickinson, John (May 28, 1985). "Stalking the Elusive Subdirectory Path". PC Magazine. p. 231.
  4. Glass, Brett (July 8, 1991). "MS-DOS 5: Reigning OS improves its value". InfoWorld. pp. 64–66.
  5. 1 2 3 Cooper, Jim (2002). Using MS-DOS 6.22 (3rd ed.). Que. pp. 120–121. ISBN   0-7897-2573-8.
  6. No DELTREE Command? - MalekTips Archived March 17, 2010, at the Wayback Machine
  7. Crayton, Christopher (2008). The A+ Exams Guide: Preparation Guide for the CompTIA Essentials. CompTIA. p. 336. ISBN   978-1-58450-566-2.
  8. 1 2 Mueller, John Paul (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. Wiley. pp. 28–29. ISBN   978-0-470-04616-6.
  9. 1 2 Rubenking, Neil J. (November 19, 1996). "User-to-User". PC Magazine. p. 247.
  10. "Datalight ROM-DOS User's Guide" (PDF). www.datalight.com. Archived (PDF) from the original on 2019-04-21. Retrieved 2020-01-18.
  11. "FreeDOS 1.2 Updates Package - deltree (FreeDOS Base)". Ibiblio.org. 2013-03-30. Archived from the original on 2021-07-30. Retrieved 2022-09-08.
  12. Glass, Brett (May 2, 1994). "How to safely defuse an ANSI bomb; video scan converters". InfoWorld. p. 40.
  13. Gaudin, Sharon (2000). "Case Study of Insider Sabotage: The Tim Lloyd/Omega Case" (PDF). Computer Security Journal. 16 (3): 1–8.[ permanent dead link ]
  14. Lange, Michele C. S.; Nimsger, Kristin (2004). Electronic Evidence and Discovery: What every Lawyer Should Know . ABA. p.  15. ISBN   1-59031-334-8. The case was litigated as United States v. Lloyd, 269 F.3d 228 (3rd Cir. 201) Archived 2016-03-03 at the Wayback Machine .

Further reading