China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 21:21
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to create an MP3 playlist with batch processing? (Winamp) Solved View 2,612 Replies 9
Original Poster Posted 2006-12-15 23:50 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
As the title says, first give the assumption. There is such a folder, "1983.Kill 'EM All", which has
1.Hit The Lights.mp3
2.The Four HorseMen.mp3
3.Motorbreath.mp3
4.Jump In The File.mp3
5.(Anesthesia)-Pulling Teeth.mp3
6.Whiplash.mp3
7.Phantom Lord.mp3
8.No Remorse.mp3
9.seek & destroy.mp3
10.Metal Militia.mp3

These MP3s.

How to create an m3u playlist with batch processing
For example: "00.Playlist.m3u"
The content inside is also very simple:
1.Hit The Lights.mp3
2.The Four HorseMen.mp3
3.Motorbreath.mp3
4.Jump In The File.mp3
5.(Anesthesia)-Pulling Teeth.mp3
6.Whiplash.mp3
7.Phantom Lord.mp3
8.No Remorse.mp3
9.seek & destroy.mp3
10.Metal Militia.mp3

How to do it???
PS: I think the production of this playlist is to extract all the file names with the MP3 suffix in the folder.
Again: There are pictures under my this file, so simply extracting all file names will put the picture names into the batch command, which is redundant!!!
Wait!!!

[ Last edited by kich on 2006-12-17 at 02:51 AM ]
Floor 2 Posted 2006-12-16 00:56 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Isn't it clear by saving an m3u in WinAMP?

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2006-12-16 04:00 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
But every time I want to make an M3U, I first have to open Winamp, then drag all the songs in, and then save it. It's really cumbersome. So, I want to make a batch file that I can just double-click to do it, which would be so convenient!!

I'm a newbie, so I don't know how to read the filenames with the MP3 extension in the folder. Hope an expert can guide me!!
Floor 4 Posted 2006-12-16 06:00 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
for /r "c:\mp3" %%i in (*.mp3) do echo %%~fnxi >> Playlist.m3u

[ Last edited by a9319751 on 2006-12-16 at 06:01 AM ]
bat c c++
Floor 5 Posted 2006-12-16 09:46 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Just save an .m3u and then echo it, just make sure the format is correct.
Floor 6 Posted 2006-12-16 14:23 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
I can't understand it very well. I'm a beginner!!!
I want to put the BAT file in the folder and then double-click to generate the list file!
How great!
Floor 7 Posted 2006-12-17 02:04 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
First, thank you to user 4th floor. According to your prompt, I used the following code and placed it in the MP3 folder:
for /r %%i in (*.mp3) do echo %%~fnxi >> Playlist.m3u

Then I executed it, but the resulting list is not satisfactory because it contains absolute addresses, such as
F:\1983.Kill 'EM All\1.Hit The Lights.mp3
F:\1983.Kill 'EM All\2.The Four HorseMen.mp3
.........

But how should I do it if I want to get like this??
1.Hit The Lights.mp3
2.The Four HorseMen.mp3
.........

PS: I'm really a newbie ah, teach me please!!!!
Floor 8 Posted 2006-12-17 02:17 ·  中国 江苏 南京 电信
高级用户
★★
Credits 623
Posts 214
Joined 2006-09-22 20:48
19-year member
UID 63387
Status Offline
/r 是 for 循环的一个参数,表示递归遍历当前目录及其子目录。原命令是遍历所有子目录下的 mp3 文件并将文件名写入 Playlist.m3u。去掉 f 后命令变为:for /r %%i in (*.mp3) do echo %%~nxi >> Playlist.m3u

按要求只输出翻译后的内容(这里原内容是英文相关操作说明,无实际需要翻译的中文,所以直接保留):for /r %%i in (*.mp3) do echo %%~nxi >> Playlist.m3u
Floor 9 Posted 2006-12-17 02:50 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
yah.......
Solved, thank you to all the above who helped me, thanks a lot!!
Floor 10 Posted 2007-06-15 10:56 ·  中国 浙江 杭州 联通
新手上路
Credits 13
Posts 6
Joined 2007-06-12 15:45
19-year member
UID 91082
Gender Male
Status Offline
Shuai Ya. Xue le yi zhao
Forum Jump: