I have a large folder of .cbr\'s, and I\'m renaming them by issue number to correctly order them. What do I need to include in the ren line to have each file increment the n
Try this batch script.
@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
)
It renames all the files with a incremental counter. The order of the files is preserved with the /OD
option of the DIR
command, that sorts the files list by its modified timestamp.
After careful testing, remove the ECHO
command.
For more information, read HELP DIR
, HELP SET
and HELP FOR
.