RemoveDirectoryA function (fileapi.h) - Win32 apps | Microsoft Learn[^]: To recursively delete the files in a directory, use the SHFileOperation[^] function.
c++ - RemoveDirectory() if the directory is not empty? - Stack Overflow[^]: If you need to remove a non-empty directory, you do a depth-first traversal of the directory structure. As you traverse an individual directory, you erase all the files it contains. If it contains any sub-directories, you traverse into them, deleting their contents then deleting the (now empty) directory. Lather, rinse, repeat.
MoveFileEx("c:\ToMove", "NUL", ...)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)