I need to delete a directory from within a MFC application. _rmdir(lpstrDir) doesn't seem to work. If I call strerror(errno) to see what the trouble is it returns "Permission Denied". However when I check the permissions on the directory, Everyone has Full Control. I can also remove the directory manually from a command prompt or through explorer. According to the documentation CFile::Remove won't work on a directory. system("rmdir c:\\dir" works, but it flashes an annoying DOS window. Is there some other way I can do this? Thanks.