Removes an existing directory or folder.
Public Sub RmDir(ByVal Path As String)
Exception type | Error number | Condition |
---|---|---|
52 | Path is not specified or is empty. | |
75 | Target directory contains files. | |
76 | Directory does not exist. |
An error occurs if you try to use RmDir on a directory or folder containing files. Use the Kill function to delete all files before attempting to remove a directory or folder.
This example uses the RmDir function to remove an existing directory or folder.
' Assume that MYDIR is an empty directory or folder.
RmDir
("MYDIR") ' Remove MYDIR.
ChDir Function | CurDir Function | Kill Function | MkDir Function |