List m3u files in folder and choose it
Posted: 11 Oct 2009 17:12
Hi!
I'm wondering if its a easier way of doing this. Been searching the forum for hints (and taking code;) the script work, but there will be alot of hardcoding I guess.. And there must be a better way of doing what I want.
I have this folder with m3u files. And I want a script to list them up in a cmd window for me to choose (From 1 to x). Then this consol player (mpxplay) will play that m3u file
Right now i have this:
If I add, say 30 more playlist I will have to hardcode ALOT since I don't know anyother way... Helpi ?
Kjell Øyvind
I'm wondering if its a easier way of doing this. Been searching the forum for hints (and taking code;) the script work, but there will be alot of hardcoding I guess.. And there must be a better way of doing what I want.
I have this folder with m3u files. And I want a script to list them up in a cmd window for me to choose (From 1 to x). Then this consol player (mpxplay) will play that m3u file
Right now i have this:
@echo off
color 30
title Playlist chooser
echo.
echo ----- Choose your playlist -----
echo.
:START
set list="C:\Documents and Settings\Administrator\Desktop\Playlist"
set player=C:\Programs\MPXPLAY\MPXPLAY.EXE
Echo.1. Tool - Aenima
Echo.2. Tool - Salival
Echo.3. Tori Amos - Abnormally Attracted To Sin
Echo.4. Harrys Gym - Harrys Gym
Echo.5. The Flaming Lips - Yoshimi Battles the Pink Robots
Echo.6. A Perfect Circle - Thirteenth Step
Echo.7. A Perfect Circle - Mer De Noms
Echo.8. The National Bank - The National Bank
Echo.9. Radiohead - Kid A
ECHO.
ECHO.0. Exit
ECHO.
(SET OPTION=)
(SET /P OPTION="> ")
IF NOT DEFINED OPTION (GOTO:START)
FOR /L %%A IN (0,1,9) DO (
IF ^%OPTION:~0,1%==^%%A (GOTO:_%%A)
)
GOTO:START
:_0
EXIT
:_1
START %player% %list%\Aenima.m3u
GOTO:START
:_2
START %player% %list%\Salival.m3u
GOTO:START
:_3
START %player% %list%\AbnormallyAttractedToSin.m3u
GOTO:START
:_4
START %player% %list%\HarrysGym.m3u
GOTO:START
:_5
START %player% %list%\YoshimiBattlesthePinkRobots.m3u
GOTO:START
:_6
START %player% %list%\ThirteenthStep.m3u
GOTO:START
:_7
START %player% %list%\merdenoms.m3u
GOTO:START
:_8
START %player% %list%\thenationalbank.m3u
GOTO:START
:_9
START %player% %list%\kida.m3u
GOTO:START
If I add, say 30 more playlist I will have to hardcode ALOT since I don't know anyother way... Helpi ?
Kjell Øyvind