Rename multiple files in a folder, add a prefix (Windows)

前端 未结 8 976
迷失自我
迷失自我 2021-01-29 18:28

I\'d like to batch rename files in a folder, prefixing the folder\'s name into the new names. i.e. files in C:\\house chores\\ will all be renamed house chore

8条回答
  •  心在旅途
    2021-01-29 19:12

    This worked for me, first cd in the directory that you would like to change the filenames to and then run the following command:

    Get-ChildItem | rename-item -NewName { "house chores-" + $_.Name }
    

提交回复
热议问题