【问题标题】:Batch command that automatically deletes a folder自动删除文件夹的批处理命令
【发布时间】:2017-07-13 06:27:59
【问题描述】:

我想删除我的文件夹C:/gametemp,因为我的游戏会自动创建该文件夹,除非我删除该文件夹,否则它不会运行。有没有办法编写一个批处理文件循环检查文件夹并自动删除它?

操作系统:Windows 7。

【问题讨论】:

    标签: batch-file windows-7


    【解决方案1】:
    RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path
    
    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.
    
    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S
    

    这是在命令提示符下删除目录及其子目录的一般过程。

    1. 在您的计算机上制作批处理文件。
    2. 使用指定路径编写上述命令
    3. 为批处理文件创建计划任务。

    【讨论】: