Software >> OS >> Windows >> Command Line >> For >> How to use for loop to rename all files with multiple words separated by a delimiter like dash and inserting additional word in the middle of the name

For example files named xx-yy-zz.ext to rename as xx-something-yy-zz.ext for /F "tokens=1-3 delims=-" %a in ('dir /b *-*-*.ext') do rename %a-%b-%c %a-something-%b-%c