Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Some sub-folders from my iTunes music folder have been deleted from my hard drive, but are still present into my iTunes library (with a "!" sign next to it, showing me that there is a problem with that song). I have a lot of those unplayable songs on my library... Is there a way to rid of all those songs ?

share|improve this question
2  
possible duplicate of superuser.com/questions/130633/… –  Shevek May 9 '10 at 20:32
1  
@Shevek: it sounds like exactly the opposite problem. will the solution to that also work for this? –  quack quixote May 9 '10 at 20:43
    
oops, yes, it is the opposite problem... sorry! didn't read it fully. My bad. –  Shevek May 9 '10 at 20:49
    
MacOS or Windows? –  Shevek May 9 '10 at 21:31
    
@Shevek: I made the exact same mistake after reading your comment voted you up, then read @quack quixote's comments and realized he's right. LOL. –  Josh May 9 '10 at 23:05

5 Answers 5

Scott Hanselman blogged a C# solution about this last week.

If you are handy with C# then its another good solution.

Source code is provided so if you have C# Express or Visual Studio then you should be good to go.

share|improve this answer
    
No need to compile or program, since the binaries are provided with the download. –  Daniel Beck Jan 26 '11 at 14:31
    
@Daniel - Ah! I didn't look in the bin directory. Good spot –  Shevek Jan 26 '11 at 15:09
    
That's why I commented on the question. Let's see if it gets you an accept. –  Daniel Beck Jan 26 '11 at 15:10

Found this but it is dated 2004 so it may not work if the iTunes API has changed in between

You will need to have Windows Scripting Host installed.

http://ottodestruct.com/itunes/RemoveDeadTracks.txt

Save this file as RemoveDeadTracks.js

Launch iTunes

Double click on RemoveDeadTracks.js

Wait!

It will display a message box when done.

share|improve this answer
    
I did this about 6 months ago, so the APIs are likely still good. –  BillN Jul 7 '10 at 21:16

Pardon my ignorance, but can you not just delete them from the library by right-clicking on them and choosing "Delete"?

share|improve this answer
1  
not when there are hundreds or even thousands of them! –  Shevek Jul 8 '10 at 7:32
    
What if you just deleted the entire library from iTunes and then re-imported the folder that contains all your music? That's a sure-fire way to make sure you only have the right stuff in there. –  jrc03c Jul 8 '10 at 13:09

I won't go into how absolutely ridiculous it is that there are people actually writing scripts and apps and selling them to fix this problem which should be a BASIC function of iTunes... but i suppose iTunes is getting a cut, so why should they fix it?...

So here is my sledgehammer approach (recommended if you have done major moving/conversion of files in library):

  1. Make sure iTunes (application) is not open
  2. Go to your iTunes directory (usually ...\My Music\iTunes)
  3. Select: "iTunes Library Extras.itdb" + "iTunes Library Genius.itdb" + "iTunes Library.itl" + "iTunes Music Library.xml"
  4. Move these to a temporary location (i.e. a folder on your desktop)
  5. Go back to the iTunes folder and open up the 'Previous iTunes Libraries' folder and delete everything inside.
  6. Open the iTunes application - you will have nothing in there because you've moved the index.
  7. Go to File>Add Folder to Library... then select the root directory of your music library.

iTunes will now rebuild your library (might take a while), and therefore not have any dead paths mixed in.

You will need to get all your album artwork again (File>Library>Get Album Artwork) and it may take multiple attempts to get it all back again as it is a little temperamental...

If you're happy with your new library, you can go and delete the original library index files you moved at step 3. If you wanted to restore your old index, just move them back again.

share|improve this answer

If you can sort the column (where the "!" symbol is displayed), then that'd be great, since you can just highlight from the very first track, down to the last (use SHIFT key to do this), and hit DELETE.

share|improve this answer
    
Sadly, that column is not sortable, which is obnoxious. –  Nathan Oct 4 '11 at 1:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.