|As is, it previews what's to be done. After testing you activate it by removing the ECHO in front of ren.|
@echo off & setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/b a-*.txt') do (
echo ren %%a 1!S!.txt
:pad to 6
if !S:~5^,1!'==' set S=0!S!& goto :pad
If at first you don't succeed, you're about average.