Is it possible to use back-references/grouping in commands? I know that I can use them as selectors but what about as replacements? For instance, I have files named Code: a1.txt b2.txt c3.txt d4.txt and I'd like to rename them Code: 1a.txt 2b.txt 3c.txt 4d.txt Using regular expressions it should be as simple as Code: ren ::(.)(.)\.txt \2\1.txt but it doesn't work. Ideas? What about using FOR or DO?