- Oct 13, 2020
- 55
- 11
it gives an extra 0 when count reaches 10, making sorting errornous, i have to delete those 0 one by one. View attachment 4539186
looks like this
Use this one instead
Echo off
setlocal enabledelayedexpansion
set "count=0"
for %%f in (CH_Save_*.png) do (
set "formatted=0000!count!"
set "newname=CH_Save_!formatted:~-4!.png"
ren "%%f" "!newname!"
set /a count+=1
)
endlocal
Last edited: