rmdir

Syntax

int rmdir(string path)

Arguments

path
The path of the folder you want to remove.

Return

Returns 0 if the new directory was removed successfully, -1 otherwise.

Description

Removes a directory/folder from the user's filesystem. The folder must already be empty. Remember to use double backslashes in the path.

Example

if (rmdir("c:\\abc\\mynewfolder") == 0) {
  msgBox(MB_OK, "Successful", "The mynewfolder folder was removed successfully.");
}
else msgBox(MB_OK | MB_ICONWARNING, "Error", "The folder could not be removed.");

Also see

getSpecialFolder, mkdir, chdir

Comments

Everyone can add their comments about their experiences with this function here. Tips for using it are welcome, too.