Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlaylistFromFolder

Generate an .m3u playlist from all the music files in a folder — straight from the Windows Explorer right-click menu.

What it does

create_playlist.py takes a directory, walks it recursively and writes an #EXTM3U playlist next to the music files. The playlist is named after the folder (My Album/My Album.m3u) and contains one absolute file path per track.

Recognised extensions: .mp3, .wav, .flac.

add_context_menu_entry.bat wires the script into Windows Explorer, so you can right-click any folder and pick Generate Playlist.

Requirements

  • Windows (for the context menu integration)
  • Python 3.x — no third-party packages needed

Install the context menu entry

  1. Clone or download this repository:

    git clone https://github.com/rennerdo30/PlaylistFromFolder.git
    cd PlaylistFromFolder
  2. Open add_context_menu_entry.bat in a text editor and point python_path at your Python interpreter. It defaults to:

    set "python_path=C:\Python312\python.exe"

    Use where python in a terminal to find yours.

  3. Run add_context_menu_entry.bat as administrator (right-click -> Run as administrator). It writes the registry keys under HKEY_CLASSES_ROOT\Directory\shell\GeneratePlaylist; without elevation the script exits with a warning.

Usage

From Explorer: right-click a folder containing music files and choose Generate Playlist. The .m3u file appears inside that folder.

From the command line: the script works standalone, no registry entry required.

python create_playlist.py "D:\Music\My Album"

Removing the context menu entry

reg delete "HKEY_CLASSES_ROOT\Directory\shell\GeneratePlaylist" /f

Run this from an administrator command prompt.

Notes

  • Subfolders are included — running it on a folder of albums produces one playlist covering all of them.
  • Paths written to the playlist are absolute, so moving the music afterwards breaks the playlist.
  • An existing playlist with the same name is overwritten.

License

MIT — see LICENSE.

About

Generate an .m3u playlist from all the music files in a folder, via a Generate Playlist entry in the Windows Explorer right-click menu. Single Python script, no dependencies.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages