如果.bat与文件位于同一文件夹中,我的代码很有用。代码来自:.bat for batch rename to increment numbers in fname
@echo off
setlocal enabledelayedexpansion
set /a count=0
for /f "tokens=*" %%a in ('dir /b /od *.cbr') do (
echo ren "%%a" !count!.cbr
set /a count+=1
)
我想特定一个可以进行上述过程的目录。
这是我的代码,但我无法让它工作。
%NewFolder% - it is specified in the code above this part.
setlocal enabledelayedexpansion
set /a count=0
for /f "tokens=*" %%a in ('dir /b /od "004 - Images Ready\%NewFolder%\"*.JPG') do (
ren "004 - Images Ready\%NewFolder%\%%a" "004 - Images Ready\%NewFolder%\"!count!.JPG
set /a count+=1
)