hansenzhang 当前离线
列兵
77七 当前离线
中校
@echo off setlocal enabledelayedexpansion set /p n=type a number: for /f "delims=" %%i in ('dir /b /a-d *.DXF') do ( set "str=%%~ni" set "str=!str:-=\!" for %%a in ("!str!") do set "m=%%~nxa" set /a k=n*m set "oldName=%%i" for /f "tokens=1-2" %%b in ("!m! !k!") do ( set "newName=!oldName:%%b.DXF=%%c.DXF!" ) ren "%%i" "!newName!" )复制代码
TOP
@echo off setlocal enabledelayedexpansion set /p n=type a number: for /f "delims=" %%i in ('dir /b /a-d *.DXF') do ( for /f "tokens=1-4 delims=-" %%a in ("%%~ni") do ( set /a m=%%d*n ren "%%i" "%%a-%%b-%%c-!m!%%~xi" ) )复制代码
jyswjjgdwtdtj 当前离线
中尉
set fso=createobject("scripting.filesystemobject") folderp=inputbox("文件夹地址") set r=new regexp r.pattern="^(.*-)([0-9]*)\.DXF" r.ignorecase=true for each file in fso.getfolder(folderp) set m=r.execute(file.name)(0).submatches a=m(1)+0 b=inputbox("b") file.name=m(0)&a*b&".DXF" next复制代码