@ECHOOFFSETLOCALENABLEDELAYEDEXPANSIONremLoadthelistofnewfilenamesseti=0for /F "delims=" %%a in (names.txt) do (set/Ai+=1set"newname[!i!]=%%a")remDotherename:seti=0for /F "delims=" %%a in ('dir /b /o:n *.*') do (set/Ai+=1for %%i in (!i!) do ren "%%a""!newname[%%i]!")