Draft for Information Only
ContentMS DOS Command: RMDIR (RD)
MS DOS Command: RMDIR (RD)Reference from Microsoft MS-DOS cmd help DescriptionDeletes (removes) a directory. Before you can delete a directory, you must delete its files and subdirectories. The directory must be empty except for the "." and ".." symbols. SyntaxRMDIR [drive:]path
RD [drive:]path
Parameters
Related CommandsFor information about creating a directory, see the MKDIR command. For information about hidden files, see the ATTRIB command and the DIR command (the /A switch). For information about deleting files, see the DEL command. For information about deleting a directory, its files, and all subdirectories and files subordinate to it, see the DELTREE command. RemarksCannot delete directory with hidden or system filesYou cannot delete a directory that contains files, including hidden or system files. If you attempt to do so, MS-DOS displays the following message: Invalid path, not directory, or directory not empty Use the DIR command to list hidden and system files and the ATTRIB command to remove hidden and system attributes from files. For more information, see those commands. Using the backslash character with the path parameter If you insert a backslash (\) before the first directory name in path, MS-DOS treats the directory as a subdirectory of the root directory--regardless of your current directory. If you do not insert a backslash before the first directory name in path, MS-DOS treats the directory as a subdirectory of the current directory. Deleting the current directoryYou cannot use RMDIR to delete the current directory. You must first change to a different directory (not a subdirectory of the current directory) and then use RMDIR with a path. If you attempt to delete the current directory, MS-DOS displays a message in the following format: Attempt to remove current directory - drive:path MS-DOS also displays this message if you attempt to delete a directory that has been redirected by using the SUBST command. ExamplesTo delete a directory named \USER\SMITH, first ensure that the directory is empty, as in the following example: dir \user\smith /a MS-DOS should display only the "." and ".." symbols. Then, from any directory except \USER\SMITH, type the following command: rmdir \user\smith You can type the following command with the same result: rd \user\smith ©sideway ID: 110700250 Last Updated: 7/29/2011 Revision: 0 Latest Updated Links
![]() ![]() ![]() ![]() ![]() |
![]() Home 5 Business Management HBR 3 Information Recreation Hobbies 8 Culture Chinese 1097 English 339 Travel 18 Reference 79 Computer Hardware 254 Software Application 213 Digitization 37 Latex 52 Manim 205 KB 1 Numeric 19 Programming Web 289 Unicode 504 HTML 66 CSS 65 SVG 46 ASP.NET 270 OS 431 DeskTop 7 Python 72 Knowledge Mathematics Formulas 8 Set 1 Logic 1 Algebra 84 Number Theory 206 Trigonometry 31 Geometry 34 Calculus 67 Engineering Tables 8 Mechanical Rigid Bodies Statics 92 Dynamics 37 Fluid 5 Control Acoustics 19 Natural Sciences Matter 1 Electric 27 Biology 1 |
Copyright © 2000-2025 Sideway . All rights reserved Disclaimers last modified on 06 September 2019