Skip to content

Instantly share code, notes, and snippets.

@amolok
Created December 20, 2013 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amolok/8051733 to your computer and use it in GitHub Desktop.
Save amolok/8051733 to your computer and use it in GitHub Desktop.
@echo off
IF [%1]==[] (
echo renumber01.cmd filemask filename
echo bis_*.bmp bis
echo bis01.bmp bis02.bmp bis03.bmp ...
echo ------------------------------------------------------------------------------------
) ELSE (
setlocal EnableDelayedExpansion
set prefix = %2
for %%a in (%1) do ( set /a i+=1 )
echo %1: !i!
set /a i = 1
for %%a in (%1) do (
set newname=00!i!
set newname=!newname:~-2!
set /a i+=1
echo %%a = %2!newname! // !pre!
ren %%a %2!newname!.*
)
echo ------------------------------------------------------------------------------------
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment