中国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-04 07:57
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to change a double extension into a single one?? For example, change *.avi.rmvb to *.flv
Printable Version  932 / 7
Floor1 xlfj521 Posted 2007-04-21 03:08
初级用户 Posts 9 Credits 20
How to change a double extension into a single one?? For example, change *.avi.rmvb to *.flv
Floor2 everest79 Posted 2007-04-21 03:13
金牌会员 Posts 1,127 Credits 2,564
You posted this twice
Floor3 flyinspace Posted 2007-04-21 03:21
银牌会员 Posts 517 Credits 1,206
@echo off & setlocal enabledelayedexpansion
for /f "tokens=* " %%i in ('dir /b ^| findstr /i "avi.rmvb"') do (
set filename=%%i
set filename=!filename: =_-!
for /f "tokens=1,2,3 delims=. " %%i in ("!filename!") do set filename=%

%i.flv
set filename=!filename:_-= !
ren "%%i" "!filename!"
)
pause

Heh, I'm still not an expert, and the code I wrote is too long... don't mind it.
Floor4 lotus516 Posted 2007-04-22 01:39
高级用户 Posts 246 Credits 551
Floor5 zh159 Posted 2007-04-22 01:47
金牌会员 Posts 1,467 Credits 3,687
Everything the poster above said is wrong. In another thread, the OP was asking how to convert *.rmvb video format to *.flv format.
Floor6 3742668 Posted 2007-04-22 01:49
荣誉版主 Posts 718 Credits 2,013

I haven't written batch files for a long time, so it feels much less familiar now.
If the printed result is correct after running it, you can try passing %%i to :Print as %2, and then change echo to ren
Floor7 zh159 Posted 2007-04-22 01:53
金牌会员 Posts 1,467 Credits 3,687
The poster above, look at reply #5

And then look at this thread
http://www.cn-dos.net/forum/viewthread.php?tid=29891
Floor8 3742668 Posted 2007-04-22 02:01
荣誉版主 Posts 718 Credits 2,013
Why be so fixated on it?
It's mainly just discussing the approach.
Besides, it's nothing more than replacing ren/echo with commands like mencoder.exe -ffourcc FLV1 -of lavf -lavfopts ……
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023