Siebel VB Language Reference > VB Language Reference >

RmDir Statement


This standard VB statement removes a folder.

Syntax

RmDir [drive:][\folder\]folder

Argument
Description

drive:

(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

\folder\

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

folder

The name of the folder to be removed

Returns

Not applicable

Usage

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.

Example

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
   Else
      RmDir "C:\TEMP01"
   End If
End Sub

Related Topics

ChDir Statement
ChDrive Statement
CurDir Function
Dir Function
MkDir Statement

Siebel VB Language Reference Copyright © 2006, Oracle. All rights reserved.