Removes (deletes) an empty directory. RD and RmDir are synonymous.
RD [path] directoryname
- 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.
- RD will only delete an empty directory. If RD is used on a directory containing files and/or subdirectories, an error message is displayed:
Invalid path, not directory,
or directory not empty
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.
- RD will not delete the current directory on the current drive. However, it will remove the current directory on a different drive.