本帖最后由 cutebe 于 2012-12-13 16:50 编辑
测试方法同上- @ECHO OFF
- SETLOCAL ENABLEDELAYEDEXPANSION
- FOR /F "DELIMS=" %%T IN ('DIR/B *.TXT')DO (
- SET ORS=&SET ORT=
- FOR /F "TOKENS=1* DELIMS=:" %%M IN ('TYPE "%%T"^|FINDSTR /N "\. ("')DO (
- SET "STR=%%N"
- IF %%M#==2# SET "ORS=!STR:~59,16!"
- IF %%M#==3# SET "ORT=!STR:~4,5!"
- )
- ECHO,REN "%%T" "!ORT!!ORS:/=!%%~XT"
- )
- PAUSE
复制代码
|