setlocal enabledelayedexpansion
set i=1
for /f "delims=" %%a in ('dir /s /b *.jpg') do (
ren "%%~pnxa" R^(20^)!i!.jpg
set /a i=!i!+1
)
set num=2
for /f "delims=" %%a in ('dir /s /b *.tif') do (
ren "%%~pnxa" R^(20^)!num!.tif
set /a num=!num!+1
)
传不了图片,大概就是这样了,把当前jpg tif文件命名成R(20)1-n这样的名字。
pause
@echo off
setlocal enabledelayedexpansion
set "filen=R999(20)"
set "newname=%filen%咨询专家"
cd/d E:\test
for /f "delims=" %%a in ('dir /b /s "%filen%*.txt" "%filen%*.tif"') do (
ren %%a !newname!%%~xa
)
@echo off
setlocal enabledelayedexpansion
set "filen=R999(20)"
set "newname=%filen%咨询专家"
for /f "delims=" %%a in ('dir /b /s "%filen%*.txt" "%filen%*.tif"') do (
ren %%a !newname!%%~xa
)
我这么测试怎么没有一点反应呢?请问大侠测试了吗?这样测试对吗?