- @echo off&mode con cols=73 lines=20
-
- ::添加的字符串
- set "str=A"
- ::设置位置
- set "pot=5"
-
- for /r %%a in (*) do if "%%~xa" neq ".bat" (
- set "var=%%~nxa"
- setlocal enabledelayedexpansion
- set "var1=!var:~,%pot%!"
- set "var2=!var:~%pot%!"
- ren "%%a" "!var1!%str%!var2!
- endlocal
- )
- pause
复制代码
|