Use the following script. It does the following: For each *.txt file in the current directory... 1. remove the first character, assuming it is an L 2. add 00 to the front 3. extracts the last 7 characters XXX.txt, where XXX is the original number padded with zeros 4. adds the L back to the front 5. does the rename
@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "delims=" %%a in ('dir /b *.txt') do (
(set i=%%a)
(set i=00!i:~1,100!)
(set i=L!i:~-7!)
echo rename "%%a" to "!i!"
rename "%%a" "!i!"
)
endlocal