回复 1# wangjnyz
请参考Q-04把bat文件保存为ANSI编码:
https://mp.weixin.qq.com/s/6lbb97qUOs1sTyKJfN0ZEQ- @echo off
- setlocal enabledelayedexpansion
- cd /d "%~dp0"
- set "Count=1000"
- for /f "delims=" %%i in ('dir /b /ad ^| findstr "北京[0-9][0-9][0-9]冬奥会"') do (
- set "Folder=%%i"
- set "Left=!Folder:~0,2!"
- set /a Count+=1
- set "Middle=!Count:~-3!"
- set "Right=!Folder:~-3!"
- ren "%%i" "!Left!-!Middle!-!Right!"
- )
复制代码
|