中国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-09-15 12:59
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » How to batch generate new files with the same file name as the original but different extensions?
Printable Version  1,683 / 13
Floor1 xlfj521 Posted 2007-04-21 21:24
初级用户 Posts 9 Credits 20
mencoder.exe -ffourcc FLV1 -of lavf -lavfopts E:\别拿豆包不当干粮02.rmvb -o E:\\别拿豆包不当干粮02.flv
This is the generation parameters and method of my program
Run in DOS
I want to generate all files in this folder
So mencoder.exe -ffourcc FLV1 -of lavf -lavfopts *.rmvb -o *.flv
That is, the new file has the same name as the original file. How to do it? Please help the expert!!!

[ Last edited by xlfj521 on 2007-4-21 at 08:42 AM ]
Floor2 xlfj521 Posted 2007-04-21 23:08
初级用户 Posts 9 Credits 20
What you said upstairs is wrong. If I just used ren, would I still post it here to ask? Don't you think about it
Floor3 wudixin96 Posted 2007-04-21 23:10
银牌会员 Posts 931 Credits 1,928
Then I'm being redundant. Consider me meddling.
Floor4 htysm Posted 2007-04-21 23:11
高级用户 Posts 415 Credits 866
@echo off
for /r %%i in (*.rmvb) do ren "%%i" "%%~ni".flv
pause

The code has not been tested. If there is any problem, please post a reply.

[ Last edited by htysm on 2007-4-21 at 11:15 PM ]
Floor5 chkau Posted 2007-04-21 23:36
初级用户 Posts 47 Credits 101
for /f "skip=5 tokens=4 delims=. " %i in ('dir *.rmvb') do del %i.rmvb&imencoder.exe -ffourcc FLV1 -of lavf -lavfopts %i.rmvb -o %i.flv
Try it yourself

[ Last edited by chkau on 2007-4-21 at 07:20 PM ]
Floor6 chkau Posted 2007-04-21 23:41
初级用户 Posts 47 Credits 101
.......I also followed and went silly
for /f "skip=5 tokens=4 delims=. " %i in ('dir *.rmvb') do del %i.rmvb&imencoder.exe -ffourcc FLV1 -of lavf -lavfopts %i.rmvb -o %i.flv

[ Last edited by chkau on 2007-4-21 at 07:19 PM ]
Floor7 zh159 Posted 2007-04-21 23:48
金牌会员 Posts 1,467 Credits 3,687
If simply changing "*.rmvb" to "*.flv", you can directly use "ren *.rmvb *.flv".
Floor8 chkau Posted 2007-04-21 23:50
初级用户 Posts 47 Credits 101
He is going to change the RMVB video file into a flash file. Just renaming it is a bunch of unexecutable junk files
Floor9 zh159 Posted 2007-04-21 23:51
金牌会员 Posts 1,467 Credits 3,687
Originally posted by chkau at 2007-4-21 10:50:
He was going to change the RMVB video file into a flash file. Just renaming it directly results in a bunch of unexecutable garbage files.

That's not called renaming at all, it's purely format conversion. Then the initial title was off-topic.
Floor10 chkau Posted 2007-04-22 00:15
初级用户 Posts 47 Credits 101
Just now, the LZ purely misled people. I only understood what was going on after reading it for a long time
Floor11 huzixuan Posted 2007-04-22 21:30
高级用户 Posts 219 Credits 537 From 芜湖
Floor12 ccwan Posted 2007-04-22 22:11
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
The landlord's problem really can't be solved just by changing the name. It is suggested that the landlord should first make up for computer knowledge.
Floor13 lxmxn Posted 2007-04-23 05:18
版主 Posts 4,938 Credits 11,386
The title of the owner and the content of the post do have some discrepancies, which can be seen as a format conversion.

Floor14 258692011 Posted 2008-02-19 00:24
新手上路 Posts 8 Credits 13
Just came to learn DOC, can't understand it.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023