ecabigting
← Back to Blog

Renaming part of a file name on multiple files

by Eric Thomas D. Cabigting
Renaming part of a file name on multiple files

How to rename part of a file name in multiple files.

  • Open Powershell (win+x) and click on Power shell
  • use CD to path to folder
Terminal
CD PATH\TO\FOLDER
  • Use the following command to replace a part of the file name of all the files in the folder
Terminal
ls | Rename-Item -NewName {$_.name -replace "OLD-FILE-NAME-PART","NEW-FILE-NAME-PART"}
  • The "OLD-FILE-NAME-PART" must be an exact character set of the part of the filename you want to replace
  • The "NEW-FILE-NAME-PART" will replace the part of the old part.

Continue Reading.