bat 批量重命名文件 并替换部分字符

  • Post author:
  • Post category:其他


处理一些任务,正好用到,记录之


1 使用for,截取_之后的文件名,并重命名

@echo off & setlocal enableDelayedExpansion
rem 1 这是提示输入文件位置,直接打开文件夹复制路径、黏贴就行
set /p path=please paste/input your Excel Path :
cd /d %path%

rem 2 这是通过循环去修改文件夹里面的文件
for /f "tokens=1-3 delims=_" %%i in ('dir /aa /b %path%'</