Here is how you can loop over only the files that begin with 4 digits followed by a space.
First you run this batch file and look at the output to make sure that everything is going to be renamed correctly:
@echo off
for /f "usebackq tokens=1,*" %%a in (`dir /ad /b "." ^| findstr /r "^[0-9][0-9][0-9][0-9] "`) do (
echo Renaming [%%~a %%~b] TO [%%~b]
)
Then you run this one (which is the same script, except it replaced the echo
statement with a real rename command) to do the renaming:
@echo off
for /f "usebackq tokens=1,*" %%a in (`dir /ad /b "." ^| findstr /r "^[0-9][0-9][0-9][0-9] "`) do (
ren "%%~a %%~b" "%%~b"
)