Table of contents
Collapse the table of content
Expand the table of content

RmDir Statement

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Removes an existing directory or folder.



The required pathargument is astring expression that identifies the directory or folder to be removed. The path may include the drive. If no drive is specified, RmDir removes the directory or folder on the current drive. Remarks An error occurs if you try to use RmDir on a directory or folder containing files. Use the Kill statement to delete all files before attempting to remove a directory or folder.


This example uses the RmDir statement to remove an existing directory or folder.

' Assume that MYDIR is an empty directory or folder. 
RmDir "MYDIR" ' Remove MYDIR. 
© 2018 Microsoft