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

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

    Based on @ofer.sheffer answer this command will mass rename and append the current date to the filename. ie "file.txt" becomes "20180329 - file.txt" for all files in the current folder

    for %a in (*.*) do ren "%a" "%date:~-4,4%%date:~-7,2%%date:~-10,2% - %a"
    

提交回复
热议问题