.bat rename files in folders/sub-folders to specific name

試著忘記壹切 提交于 2019-12-25 03:24:09

问题


I need a .bat file that can go into a folder with many sub-folders and rename every .iso file to "Game.iso". I had a way to do it but I cant seem to find it anymore and I lost the damn file :(.

Example:
-Main DIR
--A
---file name.iso
--B
---file name.iso
--Z
---file name.iso

What I want to be like when I run .bat file:
-Main DIR
--A
---game.iso
--B
---game.iso
--Z
---game.iso

That is really my main concern. That would be super amazing and I would appreciate it tremendously.


回答1:


Simple:

for /r %%a in (*.iso) do (
ren "%%~a" "%%~paGame.iso"
)

And that should work. Simply run it from the Main Dir



来源:https://stackoverflow.com/questions/25233282/bat-rename-files-in-folders-sub-folders-to-specific-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!