MSDN Library
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


Windows Mobile 6.5
A version of this page is also available for

This function deletes an empty directory. A RAPI version of this function exists called CeRemoveDirectory (RAPI).

BOOL RemoveDirectory(
  LPCTSTR lpPathName


[in] Pointer to a null-terminated string that specifies the path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete access to the directory.

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

This function operates only on empty directories. If the directory is not empty, use the FindFirstFile function, the FindNextFile function, this function, and the DeleteFile function to recursively enumerate and delete the files and subdirectories in the directory.

Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

© 2015 Microsoft