Last active
February 5, 2018 21:51
-
-
Save h3nr1ke/df55366e1cb6e4503ed7197d236f84ae to your computer and use it in GitHub Desktop.
Rename all files to a numeric sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: initial count | |
SET i=0 | |
setlocal EnableDelayedExpansion | |
:: filter for extension, jpg as example | |
for %%f in (*.jpg) do ( | |
:: rename the current file to the new name | |
ren "%%~nf%%~xf" "!i!.jpg" | |
:: increase the counter | |
set /a i+=1 | |
) | |
:: prevent closing | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment