本帖最后由 newswan 于 2021-8-29 17:06 编辑
- @echo off
- setlocal ENABLEDELAYEDEXPANSION
-
-
- set _sour_=新建文件夹
-
- pushd %_sour_%
- for /f "usebackq delims=" %%a in (`dir /b /ad`) do (
- set _code_=
- echo - %%a
- pushd %%a
- for /f "usebackq delims=" %%b in (`dir /b *.tf`) do (
- echo -- %%b
- for /f "usebackq skip=1 tokens=4,5 delims== " %%c in ("%%b") do (
- if "%%c" == "Code" set _code_=%%~d
- )
- ren "%%b" "%%~nb-!_code_!%%~xb"
- )
- popd
- ren "%%~a" "%%a-!_code_!"
- )
- popd
复制代码
|