Project will usually have an uninstall program, if the program is to do it yourself, after the uninstall program to delete all of their files, in Google for a long time finally found some relevant information, generally can only delete a file, after their own processing, you can delete all the contents of the folder, you can also include sub-folders.
The main principle is that, when exiting the program, execute a DOS command to delete, as follows:
CString Strparam;
Strparam = "/C choice/c y/n/d y/t 3 & rd/s/q \" ";
Strparam + = "D:\\test";
Strparam + = "\" ";
ShellExecute (NULL, L "open", L "cmd.exe", strparam, NULL, sw_hide);
CHOICE/C y/n/d y/t 3 & rd/s/q \ This command, which represents 3 seconds after the RD command is executed to delete a folder, may be unsuccessful on different computers because it prompts for choice not an internal command on XP. (It can be on my computer.) ), for insurance purposes, using the following code is possible, as follows:
CString Strparam;
Strparam = "/C ping 1.1.1.1-n 1-w > Nul & rd/s/q \" ";
Strparam + = "D:\\test";
Strparam + = "\" ";
ShellExecute (NULL, L "open", L "cmd.exe", strparam, NULL, sw_hide);
http://blog.csdn.net/itjobtxq/article/details/8968745
VC program quickly delete themselves (may be useful when upgrading the program)