中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-01 19:03
48,037 topics / 350,122 posts / today 2 new / 48,249 members
DOS批处理 & 脚本技术(批处理室) » Renaming files
Printable Version  897 / 5
Floor1 2bno1 Posted 2006-06-13 11:00
新手上路 Posts 2 Credits 8
Experts, I want to use a batch script to rename files in a certain folder. The renaming rule is as follows:
Take part of the original filename, then add a new suffix after it, for example
AVCQ01DY.ZIP.2006050202.ar
AVCQ01DY.ZIP.2006050302.ar
change to
AVCQ01DY.ZIP.2006050202.zip
AVCQ01DY.ZIP.2006050302.zip
How should this script be written?
Thanks!
Floor2 3742668 Posted 2006-06-13 11:51
荣誉版主 Posts 718 Credits 2,013

This should roughly meet your requirements. Of course, you can also modify it yourself according to the situation.
Floor3 2bno1 Posted 2006-06-13 13:04
新手上路 Posts 2 Credits 8
Thanks, boss, this command does run correctly.
But I'm just a beginner with batch, could you explain what the two parameters "%%~dpnxi" and "%%~ni.zip" mean?
Thanks!
Floor4 electronixtar Posted 2006-06-13 15:11
铂金会员 Posts 2,672 Credits 7,493
My answer is very simple:
ren *.ar *.zip
Floor5 不得不爱 Posted 2006-06-14 08:06
超级版主 Posts 2,044 Credits 5,310 From 四川南充
Hehe 3742668 you've made the problem too complicated!
Floor6 wydos Posted 2006-06-14 16:38
中级用户 Posts 117 Credits 304
It really was made too complicated!!!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023