【问题标题】:Delete pdf files in a folder using a batch file使用批处理文件删除文件夹中的pdf文件
【发布时间】:2012-05-30 18:14:54
【问题描述】:

我想运行一个批处理(包含 DOS 命令的 .bat),通过删除仍然存在的任何 pdf 文件来清理我的文件夹。你是怎么做到的?

【问题讨论】:

  • 请注意,我们希望看到人们在此处提问之前对他们的问题进行良好的网络搜索 - 我希望这个问题已经在互联网上得到了多次回答。

标签: file batch-file command dos


【解决方案1】:
del *.pdf /q

解释:

del   -- Dos command to delete files

*.pdf -- all files with the .PDF extension in the current directory

/q    -- Don't ask for confirmation.

【讨论】:

    【解决方案2】:

    假设只有一个目录(没有子目录): 删除 *.pdf

    【讨论】:

    • 非常感谢,这正是我的问题。
    【解决方案3】:

    http://ss64.com/nt/

    使用 /q 和 DEL 命令。

    【讨论】: