Simple Batch File for Playlist of All Files on Micro SD Card

I have been testing a simple batch file command to create a single playlist for all music files within the Music folder on my micro SD card.  This method works when the batch file is saved into the Music folder.   The player shuffle command can be set to On or Off to shuffle files while playing the playlist.

      If the batch file is saved within a subfolder within the Music folder, the command will create a playlist of all music files within the subfolder collection.

     The m3u file produced by this batch command is named Playlist.m3u   The m3u file should be renamed as needed.

            (cannot have multiple m3u files with same name)

Here is the text of the playlist command for the batch file:

@echo off
dir /o:n /s /b *.mp3 *.wma *.wav> Playlist.m3u

Create the batch file by copying these 2 lines into a text file and save as a text file named “myplaylist.bat”

I execute the batch command by double-clicking on the batch file using Win File Explorer.    .

(This method works on a PC, not on a Mac).

Please leave comments, suggestions, problems, better ideas ???

How do u do this from a Android phone?

@needhelpinhere wrote:
How do u do this from a Android phone?

You can’t. You must do it on a computer.

I do not have any Android phones or tablets. But I do like using The Google. 

I found these two possibly useful links:  Seem to require an on-the-go USB cable.

I’ve added some extra code to the batch file so it prompts you to enter a playlist name.

@echo off
set /p id=Playlist Name:
dir /o:n /s /b *.mp3 *.wma *.wav> %id%.m3u

Hope this is useful to someone :-) 

1 Like

Fantastic !!  

Thank You !!

And recently I figured out how to use my Mac Mini to execute the batch file command in a Clip Sport music folder using Wine.


Thank you - now I don’t have to throw the player away.  Pretty useless without Playlists you can manage.

Is there a way to create a single playlist which enables you to play files from the internal storage and external without messing about?

Also, I can’t seem to create a playlist on the internal storage. It says ‘File not found’ after I input a playlist name. I am using elevated permissions to run the batch file.

Hi, I really like your enhancement and it works great, but most of the time I use Ubuntu and so you guys inspired me to write a script for Linux. It may be work on Apple as well.

To get it on your computer, create an empty text file. Copy the code into it. Rename it to:

How to use it and what the commands are for is written in the ‘code’.  I hope it of use for one or the other.

#!/bin/bash # SanDisk player Clip Sport, create a playlist # run an executable on USB with ubuntu 18.04: # showexec is the option which says that you cannot execute any file on the mounted device. # To run "create\_playlist\" anyway, do this: # Copy "create\_playlist\" on/in your SanDisk Music folder. # Open a terminal and go to your SanDisk Music Folder, start the playlist creation like this: # sh create\_playlist\ (hit Enter on your keyboard). # To create a Podcast-Playlist, you must run it in the Podcast-folder on your SanDisk and copy the playlist to the Music folder. # ONLY IN THE MUSIC FOLDER YOU CAN START THE PLAYLIST !!! # The line break must be in Windows format (CRLF) = (\r\n) ! # Print the current directory/Folder echo "" echo "" echo "\*\*\* The bash-file is launched in this directory: " pwd echo "" echo "Now reading all files that ends to \*.mp3 \*.ogg \*.wma \*.wav ..." echo "" # # To get full path = "$(pwd)" # Remove a certain NUMBER of path components = cut -d'/' -f5- # add Windows line break (\r\n) at the end of each line: sed 's/$/\r/' Unix already has \n. # find "$(pwd)" -regex ".\*\(\.ogg\|\.mp3\|\.wma\|\.wav\)$" | cut -d'/' -f5- | sed 's/$/\r/' \> 000\_playlist\_$(date +%H%M%S).m3u # full path file names of the desired files # find $(pwd) -name \*.mp3 -print \> 000\_playlist\_$(date +%H%M%S).m3u # Search based on file type # find . -type f -print \> 000\_playlist\_$(date +%H%M%S).m3u echo "written the playlist to your SanDisk" echo "" # wait for to start sleep 1 # open default file manager xdg-open . # wait for to start sleep 1 echo "\*\*\*\*\*\* finished, automatic exit \*\*\*\*\*\*" echo "" echo "your file manager should open now to adjust file name" echo "" #exit



Recently I figured out how to use my Mac Mini to execute the batch file command in a Clip Sport music folder using Wine.

and I got the complete information on this article