View Single Post
Old 04-06-2014, 09:41 AM   #3
Lagopus
Member
Lagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with othersLagopus plays well with others
 
Posts: 21
Karma: 2864
Join Date: Feb 2014
Location: Norway
Device: kindle gen3
This will give a better result - it will give you filenames like page001, page010, page110 that sorts much better:

Code:
echo off
SET /a i=1
SET /a p=1
set /a maxpage=15

:loop
IF %i%==%maxpage% GOTO END

IF %p% LSS 10 (
  rename a%i%.jpg page00%p%.jpg 
) ELSE (
  IF %p% LSS 100   (
	rename a%i%.jpg page0%p%.jpg 
  )  ELSE   ( 
    rename a%i%.jpg page%p%.jpg 
  )
)

SET /a p=%p%+1
IF %p% LSS 10 (
  rename b%i%.jpg page00%p%.jpg 
) ELSE (
  IF %p% LSS 100   (
	rename b%i%.jpg page0%p%.jpg 
  )  ELSE   ( 
    rename b%i%.jpg page%p%.jpg 
  )
)

SET /a i=%i%+1
SET /a p=%p%+1

GOTO LOOP

:end
Lagopus is offline   Reply With Quote