If you’ve been using Windows Media Player for awhile, you may have built up quite a collection of playlists. They are likely in the
.wpl format as that is the default. If the time has come to convert those playlists to the
.m3u format, you’ll find no simple solution to convert them all at once. Let this script help you out.
It is a little surprising that Window Media Player, even the latest version 12, doesn’t sport some kind of bulk playlist converter. You certainly can save a
.wpl playlist as an
.m3u on a case-by-case basis, but this can be slow to do if you have lots of playlists. Let me show you.
I’m using WMP 12 on Windows 7. With a playlist open, click the
List options button at the top right of the
Play tab. This will drop a list of options including
Save list as...
Save and you’ll have an
.m3u playlist. Of course you now have two playlists, one in each format, and they’ll both display in Windows Media Player. Just delete the old one. This is all well and good but, if I have several playlists, I don’t want to do this by hand for each one. So I put together a VBScript to do it for me.
To use the script, simply create a text file and change it’s extension to
.vbs. Copy and paste the following into it.
'* Copyright (C) 2011 by David Wright (firstname.lastname@example.org)
'* All Rights Reserved.
'* Redistribution and use in source and binary forms, with or without
'* modification or permission, are permitted.
'* Additional information available at http://www.digitalwindfire.com.
Const ForReading = 1
Const ForWriting = 2
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(".")
For Each File in Folder.Files
If FSO.GetExtensionName(File) = "wpl" Then
Set infile = FSO.OpenTextFile(File, ForReading)
Set outFile = FSO.CreateTextFile(Replace(File.Path, ".wpl", ".m3u"), ForWriting)
Do Until infile.AtEndOfStream
Set matches = GetMatches(infile.ReadLine, "<media src=""(.*?)""")
If matches.count > 0 Then
outFile.WriteLine "#EXTINF:0," & Decode(FSO.GetFileName(Matches(0).Submatches(0)))
File.Name = File.Name & ".bak"
Function GetMatches(ByVal SearchString, ByVal Pattern)
With New RegExp
.Pattern = Pattern
.IgnoreCase = True
.Global = False
.MultiLine = True
Set GetMatches = .Execute(SearchString)
Function Decode(ByVal Content)
Content = Replace(Content, "'", "'")
Content = Replace(Content, "&", "&")
Content = Replace(Content, """, """")
Decode = Content
Alternatively, you may download the script in a zip file below. Once you have the file, all you need to do is place it in the folder where you have your
.wpl playlists. The default location is in a folder named
Playlists in your
Music folder, however, your mileage may vary. Once there simply double-click the file to run it. It will scan the folder looking for every
.wpl file and create an
.m3u from it. Afterwards, it will rename the
.wpl by appending
.bak onto it’s name. This will prevent WMP from reading it any longer and leave you a backup of your original playlist in case anything goes wrong.
Speaking of things going wrong, the script offers no error handling at this time so be careful with it. Personally, I recommend always backing up your current playlists somewhere else before you even begin. ONLY AFTER backing up first, would I run this script. It’s nice to be able to put things back in case disaster strikes!