Software >> OS >> Windows >> Command Line >> For >> How to use for to rename multiple files with same pattern

eg. rename <pattern1>-<pattern2> to <newpattern>-<pattern2> for /f "tokens=1,2 delims=-" %a in ('dir /b') do rename %a-%b p%b