For example, starting with:
toplevel\some random folder name\CONSTANT_STRING rest of filename.ext
and ending with
toplevel\some random folder name\CONSTANT_STRING rest of filename.ext
toplevel\some random folder name\DEPRECATED\DEP CONSTANT_STRING rest of filename.ext
I've been trying the code below:
Code: Select all
for /d %a in (".\*") do @copy "%~Fa\CONSTANT_STRING*.ext" "%~Fa\Deprecated\DEP *" 2>NUL
It works except for one glitch. The new file has part of its name overwritten instead of prefixed.
Instead of the new file being named:
DEP CONSTANT_STRING rest of filename.ext
It's named:
DEP TANT_STRING rest of filename.ext
So the 4 characters that should be prefixed, "DEP ", are actually overwriting the first 4 characters of the filename instead.. Anyone have a suggestion? I can't figure this one out.