Rename filenames and remove gaps in the order with batch -


i'm wondering how rename screenshots in screenshot folder number order. remove screenshots, game fills in gaps causes chronological issue.

it looks this:

screenshot0000.jpg screenshot0002.jpg screenshot0005.jpg 

and rename them this:

screenshot0000.jpg screenshot0001.jpg screenshot0002.jpg 

i hope don't ask here i'm sure give shot.

@echo off     setlocal enableextensions enabledelayedexpansion      pushd "x:\where\thefiles\are" && (         set "count=10000"         /f "delims=" %%a in ('dir /b /on "screenshot*.jpg"') (             echo ren "%%~fa" "screenshot!count:~-4!.jpg"             set /a count+=1         )         popd     ) 

this output console rename commands. if output correct, remove echo command.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -