Windows REN command with wildcards doesn't work

我们两清 提交于 2019-12-20 03:26:08

问题


Ok, I know the typical format for the REN command REN source dest and there are several examples to rename using wildcards.

Example:

REN *.txt *.doc

This will rename all your .txt files to .doc. Well, this is all fine and dandy, but I have a bunch of files with extensions .aaaa.bbbb and when I use the command:

REN *.aaaa.bbbb *.aaaa

I get all of my files with the extenstion .aaaa.aaaa. Now I cannot come up with a REN command to just get .aaaa extension.


回答1:


ren *.aaaa.bbbb *.

For an explanation as to why this works, see How does the Windows RENAME command interpret wildcards?




回答2:


interesting question. This removes the .bbbb:

ren *.bbbb *.

I don't know, why the result is file.aaaa and not file.aaaa. - but nevertheless, it should solve your problem.



来源:https://stackoverflow.com/questions/20060346/windows-ren-command-with-wildcards-doesnt-work

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