Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用以下命令重命名目录中的文件:
for /r %%x in (*.ath) do ren "%%x" *.txt
问题是如果文件名已经存在,则文件不会被替换。有没有一种简单的方法可以删除旧文件然后重命名新文件?谢谢
要详细说明@Ben 的评论,请使用
for /r %%x in (*.ath) do move "%%x" "%%~nx.txt" /y