RemoveDirectory (Compact 2013)

3/26/2014

This function deletes an empty directory.

Syntax

BOOL RemoveDirectory(
  LPCTSTR lpPathName
); 

Parameters

  • 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.

Return Value

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

Remarks

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.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

File I/O Functions
CreateDirectory