I hate duplicate music files when using UPnP. It happens because I bought some music in iTunes as .m4a and need to convert it to .mp3 to use it on different players. So a cleanup of my library was neccessary, but how to do it?

  1. Identify m4a files.
  • Convert it to mp3 (with iTunes).
  • Move m4a to another location outside iTunes library .
  • Remove invalid references in iTunes (because of the move).

Here is how to do on a Win 7 machine:

  1. Use terminal to list files in a text file:
    1.2 Navigate to your music folder and then
    for /r %M in (*.m4a) do @echo "%~nxM", "%~zM", "%~dpM" >> filelist.txt1
  2. Identify files to convert and convert it in íTunes to mp3
  3. Move .m4a (terminal, first navigate to your music folder and then)
    forfiles /S /M *.m4a /C "cmd /c move @file C:\TARGET"2
  4. see http://paulmayne.org/blog/2007/11/how-to-remove-broken-or-dead-tracks-from-itunes/ how to do this

1 http://superuser.com/a/458184/291367
2 http://superuser.com/a/458178/291367