How to Add a Prefix to Multiple file names

Опубликовано: 02 Март 2025
на канале: Built By Pete
65,710
823

Some times you need to add a common prefix to multiple file names. When there's lots of files to do, this is a pain to do manually one at a time. This is a short tutorial for ding this automatically as a batch using windows secure shell.

Here is the command script you need to run in powershell:

(Get-ChildItem -File) | Rename-Item -NewName {$_.Name -replace "^","PREFIX"}

Just replace the word PREFIX with what you'd like to appear before all files in a directory. Leave the "" in place.

Since making this video I have found a much easier method to create a Prefix across multiple files at once using Power Rename, part of the Microsoft PowerToys utilities. This is a simpler more intuitive method. Take a look at this video:
   • Easily Add A PREFIX to Multiple Filen...  

If you want to add a number / enumerator as a file prefix then take a look here:
   • Add Enumerator Prefix to Multiple Fil...