RemoveDirectory()

Summary

Removes a folder (directory).

Syntax

RemoveDirectory(string dir_name)

Argument Contents
dir_name The full path name of the folder (directory) to remove

Notes

  • The folder must be empty before it can be removed.

  • To put a folder into the recycle bin rather than deleting it, use PutInRecycleBin().

Example

// Remove folder MyFiles in the Data folder on drive C
RemoveDirectory("C:\\Data\\MyFiles")

Error Codes

Error Type Meaning
Error Access was denied to the folder (directory) or it was not empty

See Also

Function Summary
CreateDirectory() Creates a new folder (directory) with a default security descriptor set by the system
DeleteFile() Deletes a file
PutInRecycleBin() Puts a file or folder in the recycle bin