You won't be able to rename files directly using a wildcard character. Instead you need to locate all the applicable files and then rename each.
The script below works under the assumptions of your question/comments:
- File name is 6 chars long.
- Only the last 2 chars are interchangeable.
Of course, the script could be very easily adapted to accomodate other settings but this does just as you requested.
SETLOCAL EnableDelayedExpansion REM Set your Year, Month, Day variable values here. REM They will be used for file renaming. ... CD "C:\Path\To\Files" FOR /F "usebackq tokens=* delims=" %%A IN (`DIR "File??.txt" /B /A:-D`) DO ( REM Extract the last 2 chars of the file name. SET FileName=%%~nA SET First4=!FileName:~0,4! SET Last2=!FileName:~-2! REM Rename the file, inserting the new data. RENAME "%%A" "!First4!%Year%%Month%%Day%!Last2!%%~xA" ) ENDLOCAL
??characters always in the same position (the 5th and 6th) in the file name and always exactly two characters?