File.DeleteDirectory Method

Deletes a single, empty file directory.

File.DeleteDirectory ( path )

Prerequisites

The directory must be empty.

Parameters

path

A String that contains the path for the directory to delete, beginning with the device name and ending with the new directory name.

Remarks

This method deletes a single directory in the location specified by the path parameter, provided that the directory is empty. If any files or sub-directories exist within the directory, an error occurs.

An error also occurs if the final directory does not exist.

If any error occurs, this method throws an Exception.

Examples

File.DeleteDirectory("/ROMDISK/temp/new_directory") ' Delete "new_directory"
' if empty

See Also

File and Serial I/O | File.CreateDirectory | File.DeleteFile