You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

📰 Newsroom Update

Billie Eilish is Apple Music’s Artist of the Year for 2024. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how to delete duplicated songs all at one time?

I would like to get help deleting duplicated songs, I do not know how they got their in the first place.

Windows 7

Posted on Aug 28, 2011 10:29 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 6, 2017 10:14 PM

Some how I got duplicates of my library on iTunes and to get rid of all the new duplicates I went to the library I looked for the date the new duplicate songs were added to the library then I went to columns and where you see Artist, song,

bit rate, time, etc and added 'date added' once that's done click on the box enclosing 'date added' and you will see all songs added by date. Proceed to the last one of the songs with that date press command to highlight it then scroll all the way to the first song and press 'shift' to highlight all of the songs added on that date then simply press delete.

you will be asked if you want to delete these songs...That's it.

483 replies

Sep 6, 2015 4:35 PM in response to empi2k

As it stands I'm pretty sure the current version of the script ignores cloud copies but I would need to double check. Apple haven't updated the iTunes script interface since 2009 so working with cloud items is a bit hit and miss.


Can I check what you do and don't have, and have done so far?

You have all of the media, but it was stored on the desktop which you had backed up?

You don't have your original iTunes Library.itl file, but when you signed into to iTunes with your Apple ID you content was shown in the cloud due to iTunes Match?

You've imported the contents of your desktop folders into the library which is now trying to reconcile that with iTunes Match?

I don't have iTunes Match, but my limited experience testing iCloud Music Library suggests that iTunes should attempt to "match up" local files with the cloud items effectively deduping the collection. Whether it does the right thing with ratings, play counts, playlist membership etc. is anyone's guess.

tt2

Sep 8, 2015 6:21 PM in response to turingtest2

This is very helpful many thanks - just one question: when you see all the Duplicates after selecting show Duplicates in the menu, does this mean if you select the Duplicates there is still one original left of the same kind?

This may seem obvious but i just deleted 4 duplicates and then looking at 'Show All Files' I couldn't find a single copy of the files I just trashed?


i.e. if you have 4 Duplicates should you only select and Trash 3 of them?


Thanks for your patience

Sep 8, 2015 6:52 PM in response to turingtest2

Thanks again! You have answered my question - in fact since I put the post up here I have been going painstakingly through my iTunes and selecting and deleting duplicates leaving 1 of the originals.


Often there are up to 3/4 exact duplicates.


It would be great if there was a script or key combination which added one more criterion: 'Show Exact Duplicates and Delete All but One of them'

Sep 24, 2015 9:38 PM in response to turingtest2

I should rephrase this it's not that i deleted them it's that recently ive been getting new computers and everytime it syncs some songs will just disappear and i have no way of getting them back and the only way i can get them back is what seems like rebuying them and i don't want to do that. I haven't found any forums that touch on this topic.

Oct 26, 2015 8:56 AM in response to turingtest2

Hello Mr Turingtest2


As many have said, your dedication and willingness to help so many people, for free no less, to solve these problems (when Apple itself won't, no less!) is unbelievably amazing, and I thank you.


I couldn't find mention of this issue in the 30 pages of this thread (forgive me if I missed it):


everytime I run deduper, it crashes on: "Pass 6, processing 4 of (whatever number was selected)"
Everytime. I have tried selecting different subsets of duplicate files, within a playlist, with Exact duplicates, regular duplicates, running the script via command prompt vs regular WBSH, automatically delete and manually confirm.

Occasionally it makes it to file 5 (especially with manual confirmation), but it never gets to more than 5 (or less than 4).

If I only select 6 files (3 dupes), it goes to completion and shows the success screen.
It appears to actually be removing those first 3 or 4 duplicates before crashing.

The short version of the error message:
"AppName: wscript.exe AppVer: 5.7.0.18066 ModName: atl100.dll
ModVer: 10.0.30319.1 Offset: 000042a4"


I could post the technical info, but its quite long, so I'll only do it if it might be helpful, to not clutter up the thread...


Any idea what would cause it to crash specifically on the 4th file it processes?
I'm (still) using XP, itunes 12.0.1.26


Thanks again

Oct 26, 2015 9:16 PM in response to turingtest2

Afraid not - the only error message comes up from windows, the Microsoft (R) Windows Based Script Host.
DeDuper itself stays open and has no error message - it just freezes at "Pass 6, processing 5 of [however many files I selected]" indefinitely.


The "technical information" begins" Code: 0xc0000005 Flags: 0X00000000 Record: 0x0000000000000000 Address: 0x0000000078a642a4"

and then 78 modules about a bunch of dll's

Nothing about lines.

Nov 1, 2015 5:01 AM in response to lenardsimp

Sorry for the delay in getting back to you. I've been swamped at work lately and this one slipped my mind.


I cannot recreate the error at my end and without knowing exactly where in the script it is happening it is somewhat tricky to guess what might be going wrong. Try changing the initialization of archive from False to True on what should currently be line 155:


Archive=False ' Flag to archive at <Media Folder>\Archive instead of deleting


I'm hoping it is something in the file delete code, so not deleting the files will work around it, and you can clean up the <Media Folder>\Archive folder manually.


tt2

Nov 2, 2015 10:09 AM in response to turingtest2

Hey, no worries man!

I wouldn't have had time to try it until now anyway.


So, it seemed it was working at first - it got way past number 5.
Eventually it still crashed, but with a totally different error message, this one does have a ine number:


Script: C:\Documents...\Deduper.vbs
Line: 420
Char: 17
Error: Bad file name or number
Code: 800A0034
Source: Microsoft VBScript runtime error


It went from 118 duplicates down to 72 before it crashed, so processing 46 is a big improvement from 4 at a time!


Second time I tried, it went directly to the same error.
Next I tried clicking "no" when it asks whether to delete alternate format tracks, and it was able to finish without error.

I tried again with option yes (include alternate dupes), and sometimes it crashes it crashes instantly, other times it processes a few (maybe a dozen) before crashing with the same error as above.

Nov 3, 2015 9:46 AM in response to turingtest2

I did your suggestions in reverse order.


Anti-virus is Panda, disabled, no change.

Checked permissions, they were already full, applied to "children", took a while, tried again, no change.

Then I added the line of code... and while I had to verify every change one by one, it went through the entire library with no errors.

Having to hit "enter" for each one was still a whole lot better than manually selecting several hundred files, so I consider this a win.


Thank again.

People like you, who spend their free time helping strangers on the internet is what gives me hope for the human race!

Nov 3, 2015 4:02 PM in response to turingtest2

Basically, what happened was some iTunes updates kept erasing my playlists and some songs got copied over to my C:\ drive by iTunes. I eventually got so frustrated that I allowed iTunes to "consolidate" in an attempt to deal with my library referencing songs in 3 different locations (and probably all physically duplicated in each of those locations). I really care less about albums and the album metadata, I prefer to organize by artist and song. Each of my songs should have the proper Artist and Song metadata - I've done this manually over the years to deal with iPod sort issues.


When iTunes did this, it renamed my files to "[track number] - [song]" in the default C:\ drive location.


I was able to find a script to rename my files back to how I like them "[artist] - [song title]" in my D:\Users\Michael\Music folder.


After I solve this, I want to try your "SyncStats" tool...I have a iPod that I haven't plugged in for a while I'd like to sync data from. Maybe it would be easier to rescue song and metadata in full from my iPod? Although that would require renaming all of the files again once they're pulled off.

Nov 3, 2015 6:07 PM in response to turingtest2

Correct. Most of the broken links are in the consolidated iTunes format you described. Trying to match those with my preferred format that I've resurrected is proving difficult. My iPod is only 4GB so not all of my songs are on it but my preferred ones are.




The reason I've always done this is really just So my iPod is easier for me to scroll through. Also, digital media made the concept of albums dead to me.


/Rant

A similar habit of mine is IIl usually put secondary artists in the song title (i.e. Jay-Z - Run This Town [feat. Rihanna and Kanye West].mp3. I've never liked having one artist for only one song when it's a collaboration or rename Ozzy Osborne to Black Sabbath, Gwen Steffani to No Doubt to keep them all together. Shoot me, I guess. Nevertheless, iTunes over the last 12+ years has slowly been corrupting my way of doing things and is winning this quasi war of attrition with me. The benefit is I updated my entire libraries metadata as I added music to meet these needs so I've never had to do a massive metadata fix for artists or song titles (although, I guess now days it's easy with some of the programs out there).

/endrant


Any best strategies on how I could handle this broken links issue with a merge to my .mp3's in the format I have or is it lost?

how to delete duplicated songs all at one time?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.