Created
September 3, 2013 23:35
-
-
Save examinedliving/6431015 to your computer and use it in GitHub Desktop.
Renames a bunch of files that have an underscore as the first character to the name without the underscore. The extension and first character are changeable - also could be multiple first characters.
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
setlocal enabledelayedexpansion | |
for /r %%i in (*.html) do ( | |
set a=%%~nxi | |
set b=!a:~0,1! | |
if /i NOT "!b!"=="_ " ( | |
del "%%i" | |
) else ( | |
set c=%%~nxi | |
set d=!c:~1,1000! | |
rename %%i !d! | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment