How-to: Windows iTunes playlists the easy way

Questions/comments regarding the Audio Station can be placed here
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form: ... p?lang=enu
2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
I'm New!
I'm New!
Posts: 6
Joined: Sat Apr 02, 2011 11:54 am

Re: How-to: Windows iTunes playlists the easy way

Postby watson180 » Sat Apr 02, 2011 12:33 pm

Thanks to all it will help me too. I am using ITUNES.
I am 22. Like to pass time online to gather knowledge.
I'm New!
I'm New!
Posts: 2
Joined: Mon Apr 23, 2012 6:28 pm

Re: How-to: Windows iTunes playlists the easy way

Postby bgriffis » Mon Apr 23, 2012 6:30 pm

Thanks to all for the great help. I thought I'd give a recap of my issue/solution in case it helps anyone else. I used the command line version of the tool as I thought it would be easier to just run a batch file in the future.

I have been running Logitech Media Server for many years from Windows. Recently I moved all my music to a Synology NAS and was having trouble getting the Media Server to "see" my content on the box. So I installed Logitech Media Server on the Synology NAS itself (supported right out of the box with just a few clicks!). Everything was working great except for the fact that all my playlists were being held captive by iTunes in Windows.

My solution was to download iTunes Export from here:

I grabbed the command line version so I could write a batch file to invoke it easily. Here's the contents of my command file:

"C:\Program Files (x86)\Java\jre6\bin\java" -jar itunesexport.jar -outputDir=\\diskstation\Media\Music\iTunes\Playlis ts -musicPath=/volume1/Media/Music/iTunes/Music -musicPathOld=C:\Media\Music\iTunes\Music -fileTypes=ALL -separator=MAC -includePlaylist="Brad 4 Star Sorted,Brad 5 Star Sorted,Kids 4 Star"

In the above command line the musicPathOld is where iTunes "sees" all my files from Windows, i.e. I created a softlink at C:\Media that points to \\diskstation\Media. The musicPath is the path that gets inserted into the m3u files, which is where Logitech Media Server "sees" the music locally on the NAS. I only wanted to create a few playlists as indicated by the includePlaylist. If you get rid of that part it generates all the playlists. I also have my iTunes library xml in the default location so didn't need to specify anything there.

Anyway, I hope this helps someone else having a similar issue. Now if I want to re-create the m3u files I simply run the batch file and then rescan playlists.
I'm New!
I'm New!
Posts: 7
Joined: Sat May 19, 2012 9:25 am

Re: How-to: Windows iTunes playlists the easy way

Postby Wobblyman » Thu Dec 13, 2012 10:25 am


I was having all sorts of problems - but eventually cracked it. None of the suggestions worked, but I've probably got a slightly different setup. I don't have any music under the default \music folder. Instead, I've shared a folder called iTunes, and the music is under a folder called iTunes Music. So the path to the tunes is \\iTunes\iTunes Music. Still no luck.

Anyway, after a few hours of fiddling around, I've used the following options:
Music Folder Prefix: ../../iTunes/iTunes Music/
Playlist Separator /

All good!
I'm New!
I'm New!
Posts: 6
Joined: Wed Aug 28, 2013 7:24 am

Re: How-to: Windows iTunes playlists the easy way

Postby shank2001 » Wed Aug 28, 2013 7:28 am

I got everything to work, but any file that has a "(" or ")" in the filename cannot be read by Audio Station. Anyone have any idea why, or know a way to fix it?

Thanks for any help!
Posts: 11
Joined: Sun Jun 23, 2013 6:23 pm

Re: How-to: Windows iTunes playlists the easy way

Postby Steve1 » Sun Sep 22, 2013 4:51 pm

Thanks for the tips everyone. I had the following problem that I managed to resolve.

Playlist created without issue and appeared in DS Audio however the music could not be found showing a red cross next to each of the songs.

If you have a problem locating the files make sure that the location of the music folder is correct when scripting the iTunes export or using the GUI. The correct music prefix depends on the location of the playlist and appears to be a relative path. For example in my case the music is located on a share which is mounted at the following location on my mac:

/Volumes/New iTunes Lib/Music

HOWEVER the path your computer uses may not be the not the path that DS Audio will use. In my case the path is as follows:

../../../../../New iTunes Lib/Music/

Each of the "../" take DS Audio back up a folder level. To find out what the correct path is for your music library:

1. Create a temporary playlist in DS Audio (via the web interface) and call it "temp"
2. Add a song to the playlist
3. Locate the playlist in the filesystem called temp.m3u
4. Open the file with a text editor to find out what the path should be. You should use the path up to and including the / were all your music is kept. (If you do not have all your music organised into a single folder with the option "keep itunes folder organised" I'm guessing you will have issues!)

From what I can tell the path will be different depending on where you store the playlists and if you have personal music folders set-up on your DS.
I'm New!
I'm New!
Posts: 8
Joined: Fri Jan 16, 2015 6:32 pm

Re: How-to: Windows iTunes playlists the easy way

Postby AndyTwizzle » Thu Feb 12, 2015 10:10 pm

I'm using a Windows 7 PC with iTunes installed, opening a library file and music saved on my Synology 213air. I use iTunesexport ( to export my iTunes playlist to access and play on my Android mobile using DS Audio. Anyone know if Itunesexport will still work if I upgrade iTunes to 12.1 with 64bit? Don't want to upgrade it if I can no longer get my playlists into my phone. Does the 64bit upgrade change the nature of the library files, or just affect the way Windows runs the iTunes application.

I also sync my iTunes library with Logitech Media Server on the Synology, so I can access all my music on my 3 Squeezeboxes around the house - does anyone know yet if the 64bit iTunes upgrade will affect LMS's syncing with my iTune library too?


I'm New!
I'm New!
Posts: 3
Joined: Sun Jan 08, 2017 8:54 pm

Re: How-to: Windows iTunes playlists the easy way

Postby abdam » Sat Jan 14, 2017 5:39 pm

Hi I just thought I would share extra information about this. I used this post as inspiration (i.e. using iTunesexport) and I've managed to come up with a Powershell Script that uses the "Console Application" version of ( that dynamically exports a play list (including new ones, hence it's dynamic) and the automatically edits the .m3u to make it compatible with synology.

Things you will need to make sure is:
Know where "iTunes\iTunes Music Library.xml" is being generated (To generate it, Edit > Preferences > Advanced > "Share Itunes Library XML with other applications")
Know the path to your music folder (e.g. "\\nas\music")
Know where you want your playlists to be exported to (e.g. "\\nas\music\playlists")
Know what playlists you want to exclude (e.g. Recently Added, Recently Played ect...)
You may need to enable powershell scripts to run, Run "Windows PowerShell" 'As Admin' and execute the code

Code: Select all

set-executionpolicy unrestricted
. You can check it with

Code: Select all


This example should just work if your Itunes music is saved on your Synology box to "\\nas\music\iTunes\iTunes Music Library.xml" with your music in "\\nas\music\" and your out put playlists in "\\nas\music\playlists"

1. Download and exact the "Console Application" version of ( - I used ""
2. Next to the "itunesexport.jar" you extract, make a .ps1 file with this in it:

Code: Select all

#Set Music Path
$MusicPath = "\\nas\music"
#Set Playlist Path
$PlaylistOutputPath = "$MusicPath\playlists"
#Playlists to exclude
$ExcludePlaylist = "Classical Music, 90s Music, Music Videos, My Top Rated, Recently Added, Recently Played, Top 25 Most Played"

java -jar itunesexport.jar -library="$MusicPath\iTunes\iTunes Music Library.xml" -fileTypes=ALL -musicPath="$MusicPath\" -excludePlaylist="$ExcludePlaylist" -outputDir="$PlaylistOutputPath\"

Get-ChildItem "$PlaylistOutputPath" -Filter *.m3u |
Foreach-Object {
    Write-Host "$PlaylistOutputPath\$_"

    #filter and save content to the original file
    (Get-Content $PlaylistOutputPath\$_).replace('\\nas\music', '..') | Set-Content $PlaylistOutputPath\$_
    (Get-Content $PlaylistOutputPath\$_).replace('\', '/') | Set-Content $PlaylistOutputPath\$_
Read-Host "Press ENTER to Continue"

and edit the:

Code: Select all

#Set Music Path
$MusicPath = "\\nas\music"
#Set Playlist Path
$PlaylistOutputPath = "$MusicPath\playlists"
#Playlists to exclude
$ExcludePlaylist = "Classical Music, 90s Music, Music Videos, My Top Rated, Recently Added, Recently Played, Top 25 Most Played"
and you may need to edit the text string you want to edit that leads up to the "root" of your music in

Code: Select all

Get-Content $PlaylistOutputPath\$_).replace('\\nas\music', '..')"

3. Run the ".ps1" file you made (Right click it, "Run With PowerShell")

Thats it.

You should see a list of the playlists it exports at the end. Feel free to edit the script to match what you would like it to do, I hope this helps.

Return to “Audio Station”

Who is online

Users browsing this forum: No registered users and 1 guest