1

Using:

mplayer "path\to\media\*.*"

doesn't work with MPlayer for Windows.

How do I play all files in a directory?

4
  • Try the manual page: mplayerhq.hu/DOCS/man/en Jun 24, 2013 at 3:58
  • @MichaelFrank: I didn't find it in the 147-page manual. That's why I turned here. So, if you know the lines/section, please tell.
    – antonio
    Jun 24, 2013 at 11:34
  • @antonio: Does something like for /r "C:\Music" %a in (*.mp3) do @mplayer "%~a" help?
    – Karan
    Jun 26, 2013 at 21:42
  • The code snippet in your question answered mine on how to glob all files in a directory for mplayer on linux. Thanks. Jun 27, 2016 at 3:53

3 Answers 3

1

A nice way is to make playlists and play by i.e.

  mplayer -loop 0 -playlist album.m3u

If you are in a directory of mp3 files you can pipe them to mplayer. On Windows it would be

 mplayer dir *.mp3.

This will result in mplayer playing all mp3 files in directory. Keyboard controls like next / > are working now as well.

Easiest way to create playlists are by commandline, ie: on MSwindows

DIR *.mp3 /A-D/B/S/ON > playlist.m3u 

will add all files in current and all subfolders to playlist.m3u.

2
  • mplayer dir *.mp3 doesn't work for me. It tries to play the file dir. Also dir *.mp3 | mplayer doesn't work. I have seen that I can play files like this: mplayer song1.mp3 song2.mp3 ...; but how to pipe the songs? I have MPlayer Redxii-SVN-r36243-4.6.3
    – antonio
    Jun 24, 2013 at 11:21
  • commands can be joined, i have script like that in .cmd that is in path on windows: dir *.mts,*mp4 /A-D/B/S/ON > "%TEMP%\mp_playlist.txt" && mplayer.exe -loop 0 -playlist "%TEMP%\mp_playlist.txt"
    – marioosh
    Feb 5, 2021 at 12:12
0

It is now clear there is no option to play a folder in MPlayer. So we have to turn to the OS services.
The choice much depends on your creativity, anyway, for the Command Prompt forfiles is rather standard (and a bit shorter than for):

forfiles /p "path\to\media" /c "mplayer \"@file"

Add /s before /p to recourse subdirs.

Of course, use MPlayer path if its directory is not in the PATH variable.

In Powershell replace \" with 0x22:

forfiles /p "path\to\media" /c "0x22mplayer0x22 0x22@file"

If you prefer something more native:

dir -file -r "path\to\media" | % {mplayer $_.fullname}

To recourse subdirs, use -r near -file.

None of these command is a breeze to type, therefore you might want to wrap them in a batch script.

0

I am able to use commands to run all MP3 files under a folder as below.

1st line: Add MP3 files to a playlist file (playlist.m3u). 2nd line: Play the playlist file in Windows Media Player.

dir path\to\media /A-D/B/S/ON > playlist.m3u
start "wmplayer" path\to\playlist.m3u

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .