【发布时间】:2013-01-03 06:16:33
【问题描述】:
我需要删除以特定字符串“用户”开头的目录,并且我还需要删除目录中的所有子文件夹。 我使用了 removedirectory ,它仅在目录为空时删除。
【问题讨论】:
标签: visual-c++ directory
我需要删除以特定字符串“用户”开头的目录,并且我还需要删除目录中的所有子文件夹。 我使用了 removedirectory ,它仅在目录为空时删除。
【问题讨论】:
标签: visual-c++ directory
Normally I would open a command window then cd to the directory you want to delete,
Enter the command: "del /S /F *.* *" to delete all files and subdirectories.
Backup to the parent directory: cd ..
Remove the directory: rmdir "user*"
Use "del/?" to see all the options for del.
If you have to do this in c++, you can use the "system()" call.
BTW: I did not test this just now, so no guarantee.
【讨论】: