How to Quickly Create M3U Playlists Using Command Prompt

There are many different types of music playlists that are used by a myriad of music player applications on Windows and other platforms. Out of these playlists file types PLS, M3U and M3U8 are the most popular. Actually M3U8 playlist is exactly the same as M3U except that M3U8 supports unicode characters. Not only M3U playlists supported by a large number of media players such as VLC, WinAmp, and XMMP but it is also the easiest to create. Actually the M3U playlist file contains only the filenames of the music files with one filename per line.

Here is how you can quickly create an M3U playlist for your music files:

  1. Launch Windows File Explorer and open the folder where your music files reside.
  2. Press Alt+D, type cmd and press Enter to launch command prompt with that folder as the current directory.
  3. In the command prompt give the following command: DIR /B /ON *.mp3  > myplaylist.m3u Creating M3U Playlists
  4. This is it, now you have the playlist file named myplaylist.m3u in that folder. You can try opening this playlist in any music player such as VLC or XMMP.Creating M3U Playlists

The above command puts all the MP3 files in the playlist. If you have music files of other types such as FLAC or WMV, then you can also put them into the playlist using the same syntax. The /ON switch in the command is not really necessary but it creates the list in the alphabetical order which looks much more neat.

Creating M3U Playlists

You can open this playlist file in any text editor such as Windows Notepad and view or edit it yourself. But creating this file using the command above is much faster and also error free. If you create the same file by typing the files by hand, then you might make some mistakes (human error). But using the above command all these human errors can be avoided and your precious time is saved.

2 comments

  1. Try Powershel,
    Save the below as “name.ps1”
    Open PowerShell
    Drag-Drop the file into PowerShell
    Hit “Enter”
    Will ask for full path music folder

    If all your music library in in “D:\Music”, with folders for each album, then add “D:\Music” and hit “Enter”.
    Check each Album folder and you should find the “.m3u” file with the same name and the Abum folder.

    $GetPath = Read-Host -Prompt ‘Library Folder Path’
    $dir = dir $GetPath | ?{$_.PSISContainer}
    foreach ($d in $dir){
    $path = $d.FullName

    Get-ChildItem -Path $path -include *.flac,*.ogg,*.mp3 -name | Out-File -Encoding UTF8 $path\”$d.m3u”
    }

  2. This works, but only with file names with standard English characters. If the file names have characters used in any other language in the World (not only Asian languages, but also characters with tilde such as á, é, í, ó, ú) then the resulting m3u file will have invalid characters because of the encoding.

Comments are closed.