中国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-06 02:03
48,039 topics / 350,124 posts / today 2 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to batch rename filenames that follow a pattern?
Printable Version  900 / 3
Floor1 pxk Posted 2007-10-11 23:58
新手上路 Posts 1 Credits 4
Floor2 guixi Posted 2007-10-12 00:17
初级用户 Posts 29 Credits 76
echo off
cd\
cd \d 路径
for /f "tokens=1*" %%a in ('dir /b/s/a-d *.mp3') do (
copy %%~sa "%%b" &&del%%~sa
)
pause

2.------------------------------------

echo off
cd\
cd \d 路径
for /f "tokens=1,2" %%a in ('dir /b/s/a-d *.mp3') do (
copy %%~sa "%%b.mp3" &&del%%~sa
)
pause


Untested, make a backup before running it

[ Last edited by guixi on 2007-10-12 at 12:19 AM ]
Floor3 bbq5201 Posted 2007-10-12 09:43
初级用户 Posts 51 Credits 136
Have you tested it??
Doesn't seem like it'll work...
What did you use to split it?
Floor4 不得不爱 Posted 2007-10-12 10:08
超级版主 Posts 2,044 Credits 5,310 From 四川南充
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023