【问题标题】:How to batch rename multiple files which have two periods on Windows 10如何在 Windows 10 上批量重命名具有两个句点的多个文件
【发布时间】:2021-04-16 17:26:45
【问题描述】:

我们在一个由 SSMS 创建的文件夹中有 1000 多个文件,例如

"aaa.storedporcedure.sql"
"bbbb.storedporcedure.sql"
"ccccc.storedporcedure.sql"
...

We want to remove the .storedporcedure from the file name to have the below file name'
"aaa,sql"
"bbbb.sql"
"ccccc.sql"
...

最好的方法是什么?

【问题讨论】:

  • "aaa,sql" 是一个错字,我猜。

标签: windows rename filenames


【解决方案1】:

未经测试。从文件所在目录中的控制台运行它。如果您想在批处理文件中使用它,请将所有百分号加倍。

for /f "tokens=1,2 delims=." %a in ('dir /B') do ren %a.%b.sql %a.sql

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-16
    • 2021-02-03
    • 2010-09-08
    • 2019-01-25
    • 1970-01-01
    • 2013-03-13
    相关资源
    最近更新 更多