Deltree |
Deletes a directory and all the subdirectories and files in it. Syntax:To delete a directory and all the subdirectories and files contained therein:
To delete all the files and subdirectories but leave the directory itself:
To delete a file:
Notes:The DELTREE command deletes all files contained in a directory or subdirectory, regardless of whether files are marked as hidden, system, or read-only. Unlike the typical syntax order for most Dos commands, if the /Y switch is used, it must precede the directory parameters. The DELTREE command supports wildcards, but they should be used with some caution. If you specify a wildcard that matches both directory names and filenames, both the directories and files will be deleted. Before specifying wildcards with the DELTREE command, use the DIR /A command to view the files and directories you will delete. It is also safest to specify the full path to avoid any surprises from ambiguous specification. Only the files in the top directory deleted with DELTREE can be recovered using UNDELETE. Files in subdirectories are lost forever - as far as Dos is concerned, anyway. Examples:To delete the TEMP directory on drive C, including all files and subdirectories of the TEMP directory:
To delete all the files and subdirectories in the "temp" directory leaving an empty "temp" directory for future use, and avoiding the prompt for confirmation:
To delete the read-only file text.doc in the c:\data directory (without resetting the attributes):
Exit Codes:
File Details
Superscripts denote which same size files, if any, are identical (using FC). |
|