[
@echo off
cls
::清除变量
set rDir=
set sCom=
set aDir=
set rdir=%cd%
::获得目录
dir /ad /b >vDir.txt
::方便为 rName.bat 添加 FOR 循环处理
set sCom=FOR /F "eol=; tokens=*" %i in (../vFile.txt) do @echo rename "%i" "%aDir%%i"
echo %sCom% > sCom.txt
FOR /F "eol=; tokens=*" %i in (vDir.txt) do (echo @echo off & echo cd "%i" & echo set aDir=%i & echo dir/b ^>../vFile.txt & type sCom.txt & echo cd ..)>>rName.bat
pause
]