【问题标题】:how to recursively delete directory starting with "xxxxx"?如何递归删除以“xxxxx”开头的目录?
【发布时间】:2013-01-03 06:16:33
【问题描述】:

我需要删除以特定字符串“用户”开头的目录,并且我还需要删除目录中的所有子文件夹。 我使用了 removedirectory ,它仅在目录为空时删除。

【问题讨论】:

    标签: visual-c++ directory


    【解决方案1】:
        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.
    

    【讨论】:

      猜你喜欢
      • 2023-01-08
      • 2014-05-12
      • 1970-01-01
      • 2018-10-15
      • 1970-01-01
      • 2011-07-13
      • 2016-04-18
      • 1970-01-01
      相关资源
      最近更新 更多