batch-file - 删除名称以命令提示符(批处理)开头的文件夹

标签 batch-file command command-prompt

我阅读并尝试了一些代码

  • What's the fastest way to delete a large folder in Windows?(rmdir /s /q folder)
  • Delete Files with Windows Command Prompt

  • 我想创建一个批处理,删除一个以Test_开头的文件夹。我有一个文件夹D:\Test_123_19_10_2012

    如何以批处理或命令提示符编写?需要正则表达式吗?

    多谢您的耐心配合。

    最佳答案

    干得好

    for /d %%a in (D:\Test_*) do rd %%a /q
    
    for循环是必需的,因为rd似乎不支持通配符。

    关于batch-file - 删除名称以命令提示符(批处理)开头的文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12972670/

    相关文章:

    syntax - 批处理脚本: The syntax of the command is incorrect - when script is going trough subdirectories?

    batch-file - 邮寄一个txt文件的内容

    powershell - 从远程命令调用获取输出

    c# - 如何将 CommandParameter 传递到 AsyncCommand 中?

    带命令的 Java 聊天服务器

    batch-file - 如何使用批处理将文本中的特定行提取到另一个文本。

    node.js - 批处理文件调用 Node.js - 如何从 Node 设置 ERRORLEVEL

    batch-file - 批量命令行参数匹配

    找不到 php 命令