RD (or RmDir)

Index

Removes (deletes) an empty directory. RD and RmDir are synonymous.

Syntax:

RD [path] directoryname

Notes:

  1. If there is a backslash ( \ ) before the first directory name in path, that directory is considered a subdirectory of the root directory on the current drive.

    If there is no backslash before the first directory name in path, the directory is considered a subdirectory of the current directory.

  2. RD will only delete an empty directory. If RD is used on a directory containing files and/or subdirectories, an error message is displayed:

    
    C:\WINDOWS>RD \test
    Invalid path, not directory,
    or directory not empty
    
    C:\WINDOWS>_
     

    If this message is received and the directory appears empty, it usually means that there are hidden files still there. These can be seen using the DIR /A command and any such files deleted after removing the necessary attributes with the ATTRIB command. Alternatively the DELTREE command will remove the directory along with all files and subdirectories contained therein.

  3. RD will not delete the current directory on the current drive. However, it will remove the current directory on a different drive.

File Details:

Internal


If you should have any comments or suggestions,
please contact: Bob Watson
.
This page last revised:
December 9, 1999.