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.
我正在尝试批量重命名使用以下方案命名的几个文件:picture.scn_xxx.png.
picture.scn_xxx.png
xxx
00000001
99999999
.scn
picturexxx.png
我在命令中尝试了以下内容:
ren picture.scn_*.png image*.png
但是,这并没有给我想要的结果,而是得到image.scn_xxx.png了。没有被.scn删除(我希望得到imagexxx.png)
image.scn_xxx.png
imagexxx.png
for /f "tokens=1* delims=_" %A in ('dir /b /a-d "picture.scn_*.png"') do ren "picture.scn_%B" "picture%B"
如果在批处理文件中使用,则必须更改为%Aand%B%%A%%B
%A
%B
%%A
%%B