发布网友 发布时间:2022-03-19 00:05
共1个回答
热心网友 时间:2022-03-19 01:51
@echo off&setlocal enabledelayedexpansion
cd /d %~dp0
if not exist se_b md se_b
for /f "delims=" %%a in ('dir /a-d/s/b se_*') do (
set Dir=%%~dpa
call:GetDirName "!Dir:~,-1!"
move "%%~a" "se_b\!str!%%~xa"
)
for /f "delims=" %%a in ('dir /a-d/s/b b_*') do (
set Dir=%%~dpa
call:GetDirName "!Dir:~,-1!"
set File=%%~nxa
ren "%%~a" "!str!!File:~1!"
)
pause
exit
:GetDirName
set str=%~nx1
放在那些文件夹一起后运行。