r/PowerShell • • Nov 19 '25

Question Help with folder rename script

Hello, Looking to bulk rename 100s of folders. I have a CSV which contains the full folder name

E.g

C:\dump\folder 1

and next to it what i would like the folder to be renamed, again full folder path rather than just new name

C:\dump\folder renamed

This CSV structure contains multiple sub folders all listed with full folder path rather than just folder name

What would the script be to bulk rename them

CSV titles are old and new

Do i need to ammend so its not full folder path but just folder name for the subfolders etc.

Thanks

4 Upvotes

5 comments sorted by

View all comments

Show parent comment

3

u/BlackV Nov 19 '25

p.s. formatting

  • open your fav powershell editor
  • highlight the code you want to copy
  • hit tab to indent it all
  • copy it
  • paste here

it'll format it properly OR

<BLANK LINE>
<4 SPACES><CODE LINE>
<4 SPACES><CODE LINE>
    <4 SPACES><4 SPACES><CODE LINE>
<4 SPACES><CODE LINE>
<BLANK LINE>

Inline code block using backticks `Single code line` inside normal text

See here for more detail

Thanks