I have a bunch of files that I need to rename. They are variable length. Like this:
A1B2C3D4.en.fr.pdf
A1B2C3D4S8.it.fr.pdf
A1B2C3.de.fr.pdf
A1B2C3D4E5.zn.fr.pdf
I want to change them so that I can run a .bat file to make 2 changes: prefix them all with a static prefix, XYZ10; replace the .*.fr.pdf variable ending with the static FRFR.pdf;. So they'll look like this:
XYZ10A1B2C3D4FRFR.pdf
XYZ10A1B2C3D4S8FR.pdf
XYZ10A1B2C3FRFR.pdf
XYZ10A1B2C3D4E5FRFR.pdf
I've been doing it in individual steps each time with power shell but it's a pain to keep doing it and sometimes it does it improperly.
I've tried this:
@echo off
ren *.??.fr.pdf *.FRFR.pdf
but it just makes them look like this:
A1B2C3D4E5.zn.fr.FRFR.pdf
I don't know where to begin with the prefix, I don't really understand any of the things I've been reading about it...
EDIT: This is what I've been doing to prefix in PowerShell.
Dir *.pdf | rename-item -newname {"XYZ10"+ $_.Name}