Simple Playlist Generator.


Keeping it simple: PLAYLIST.BAT

This simple bat file will play your MP3, RA, WAV, etc tunes with no fuss, no bother.

Just drag and drop the directory full of music files to this icon, and up comes Windows Media Player and plays the whole album, or even your entire music file collection! Files can be anywhere on your system or network; any directory tree depth. You can use this with some other players as well.


Win98 Version


REM Change code page to list names that contain accented characters
CHCP 1252
set target=%1
If NOT "%1"=="" goto run
set target="d:\program files\mpeg\tunes"
:run
dir %target%\*.mp* /s/o/b > c:\temp\tmp.m3u
dir %target%\*.wav /s/o/b >> c:\temp\tmp.m3u
dir %target%\*.wma /s/o/b >> c:\temp\tmp.m3u
dir %target%\*.ra  /s/o/b >> c:\temp\tmp.m3u
dir %target%\*.mid /s/o/b >> c:\temp\tmp.m3u
start "c:\Program Files\Windows Media Player\wmplayer" c:\temp\tmp.m3u
rem pause
echo off
cls

This version uses my default directory full of music, so if you don't drag and drop a directory to the batch file icon, it just plays everything in D:\program files\mpeg\tunes. You will want to change that to point to your stash of tunes.

Windows 98 batch files have some quirks.
Note that under Win98 "dir /s" does not work below the CD root directory, and this script may not produce any results. The problem is probably in the very duggy Win98 version of CDFS, which also does strange things to filenames, related to ISO9660 (8.3 uppercase etc).
This batch file:
1. puts long (c/w spaces) path names in quotes, to avoid the issues with 8.3 names.
2. To make the batch file close automatically, the easiest thing is to put "echo off" somewhere in the script, and close with "cls". You could also use a PIF file, but that's extra clutter.

Also: Be sure that the directory "C:\temp\" exists.

For more about W98 and other MS windows batch files, see my ISP web pages. (click here)


NT Version (NT4,Win2K,XP)



@echo off
:: change code page to list names that contain accented characters
CHCP 1252
if %1""=="" goto message
if not exist c:\temp mkdir c:\temp
if exist c:\temp\tmp.m3u del c:\temp\tmp.m3u
if ERRORLEVEL 1 goto running
dir %1\*.wav /s/o/b > c:\temp\tmp.m3u
dir %1\*.mp3 /s/o/b >> c:\temp\tmp.m3u
dir %1\*.wma /s/o/b >> c:\temp\tmp.m3u
dir %1\*.ra  /s/o/b >> c:\temp\tmp.m3u
dir %1\*.mid /s/o/b >> c:\temp\tmp.m3u
c:
cd c:\program files\windows media player
:: mplayer 6
:: start mplayer2.exe c:\temp\tmp.m3u 
:: mplayer 7
start wmplayer.exe c:\temp\tmp.m3u
exit

:message
echo -------------------------------------------
echo **No target files. Drag and drop on icon.**
echo -------------------------------------------
pause
exit

:running
echo ------------------------------------------------
echo **Please close existing mplayer and try again.**
echo ------------------------------------------------
pause
exit


BTW, you can add jpeg and avi files in your playlist too, anything the player will handle, by using the appropriate extensions in the DIR commands.

This page hosted by Yahoo! GeoCities Get your own Free Home Page

Back to my Geocity Home Page.