Hello @Maikel ,
Can you try out the below script:
**Start of script **
setlocal enableDelayedExpansion
for %%F in (master*.txt) do (
set "name=%%F"
ren "!name!" "!name:master=123456!"
)
**End of Script **
Explanation of the script
Line No1:- Why to use enableDelayedExpansion :- https://ss64.com/nt/delayedexpansion.html
Line No4:- How the rename command works with regular expressions :- https://superuser.com/questions/475874/how-does-the-windows-rename-command-interpret-wildcards
**End of Explanation of the script **
I just tested it locally:


Regards,
Shiva