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

前端 未结 8 1111
迷失自我
迷失自我 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:02

    Based on @ofer.sheffer answer, this is the CMD variant for adding an affix (this is not the question, but this page is still the #1 google result if you search affix). It is a bit different because of the extension.

    for %a in (*.*) do ren "%~a" "%~na-affix%~xa"
    

    You can change the "-affix" part.

提交回复
热议问题