Siebel VB Language Reference > VB Language Reference >

RmDir Statement

This standard VB statement removes a folder.


RmDir [drive:][\folder\]folder



(Optional) The name of the drive from which the folder is to be removed, as a letter, or a string expression representing the drive name


If the folder is to be removed from a folder other than the default folder of the specified drive (or the default drive if none is specified), the path to the folder to be removed


The name of the folder to be removed


Not applicable


The folder to be removed must be empty, except for the working ( . ) and parent ( .. ) folders.

The default folder cannot be removed. To remove the default folder, you must first make another folder current on the drive on which the folder to be removed resides.


This example makes a new temporary folder in C:\ and then deletes it.

Sub Button_Click
   Dim path as String
   On Error Resume Next
   path = CurDir(C)
   If path <> "C:\" then
      ChDir "C:\"
   End If
   MkDir "C:\TEMP01"
   If Err = 75 then
      RmDir "C:\TEMP01"
   End If
End Sub

See Also

ChDir Statement
ChDrive Statement
CurDir Function
Dir Function
MkDir Statement

Siebel VB Language Reference