How to change the play count number in iTunes

Time to read: 2 minutes

UPDATE: This does not seem to work in Windows 8.  If anyone has an idea how to make this work in Windows 8, let me know.  Tkx.

UPDATE 2: This did NOT work for me in Win8/64bit using iTunes 10.7.  However, since iTunes 11 came out, it works again with no addtl changes.  Can’t explain that.

It’s been awhile since I posted some sort of tech/computer thing on this blog, but when I was using this little tip myself today, I thought I’d share it.  I can’t remember how I happened upon this, but I wanted to pass on the info.

NOTE: This is for Windows.  I have no idea how you’d do this on a Mac.

One thing I’ve noticed about iTunes is that not everything is easily changeable.  For instance the play counts.  There’s been times where I’ve accidentally deleted an album with playcounts, and wanted to get back what I had.  Or I’ve imported a new version of an album, and I wanted to transfer over my playcounts, but you can’t do that in iTunes itself without resorting to playing the track the number of times you want, and shifting the slider bar to the last two seconds so the playcount gets increased.  Those kind of tricks aren’t needed anymore.  Just follow these steps.

Open Notepad and put the following text in it:

Dim iTunesApp, currTrack, newPlayCount
 Dim prompt, title, defaultValue

 Set iTunesApp = WScript.CreateObject("iTunes.Application")
 Set currTrack = iTunesApp.CurrentTrack

 prompt = "New playcount:"
 title = currTrack.Artist & " - " & currTrack.Name
 defaultValue = currTrack.PlayedCount

 newPlayCount = InputBox (prompt, title, defaultValue)

 If IsNumeric(newPlayCount) Then
 If newPlayCount >= 0 Then
 If Len(newPlayCount) > 0 Then
 currTrack.PlayedCount = newPlayCount
 End If
 End If
 End If

Save the file as “SetPlayCount.vbs”, putting it in some easily accessible location.  When you double click on it, a box will pop up, asking you what you want the playcount to be.

One caveat, it only works on one song at a time.  It will be the “selected” song.  Whether it’s playing or not, it will only edit the one track that you have highlighted in iTunes.  If iTunes isn’t running, or you don’t have anything selected (like you just started iTunes), it will error as well.

It’s not perfect, but it is useful if you want to change the playcount of an individual track in iTunes.


  1. it works perfect! thanks for solving my problem!
    Ive been wondering how i can change the play counts for a long time and ill be using this method often!

  2. Nice iTunes vbs trick! I hate having duplicate songs with varying play counts and this is a good way of combining the play counts and deleting one.

  3. Its great thanks a lot!

  4. not working for me… Error is:

    Line: 8
    Char: 2
    Error: Object required
    Code: 800A01A8
    Source: Microsoft VBScript runtime error

    I’m running Windows 7

  5. Works great, thanks alot, much easier than the other method.
    Would it be possible to edit this file to alter the ‘Last Played’ info?

  6. it is very helpful…

  7. Wow! It worked!

  8. It only works for me when the song is actually playing. Otherwise it changes the last song played/give an error message.

    Great tool though – had some well played songs which appeared to have their playcount go up 10x, messing up some smart playlists.

  9. Thank you so much ! Great little tool works perfectly !

  10. Great!! I was tinkering with the iTunes.xml file, modifying playcount but everytime I went back to iTunes, the count never changed and the .xml file reverted. Odd. Searching Google, I came across this tip and it works. THANKS so much!

    I did get the error message like the above posts, but I played the track and then tried the script and that’s when it worked.

  11. Thanks a lot! it works for me !

  12. Amazing!!! I’ve been looking for this for so many time. THANK YOU!!!!

    For me, the song has to play… only selected won’t do it. Minor detail. ;-)

  13. Oh my gosh. I have been searching for something like this for so long. Thank you so much! Works Perfectly!

  14. Wow you’re awesome! Thanks so much!

  15. This works perfectly, when I update an inferior quality song with a new version I can now keep the recorded play counts. Many thanks!

  16. this is wonderful. thanks so much!

  17. OMG THANK YOU!!!!
    This helped so much

  18. 8/24/2012 – It works! Just follow the instructions ^_^

  19. OMG this is Awesome! Thanks for sharing!

  20. It works great! Thanks!

  21. Works like a charm! In my case, iTunes 10.7 on Windows 7, it only works with the song that is playing.

  22. When I double click it just opens back in notepad, what have I done wrong?

  23. Thank you so very much! I have a kind of OCD about my play count, and the past few nights, I’ve been falling asleep with music on repeat. I could take away the extra plays quite easily with this. Thanks again!

  24. Solved a problem that was really getting to me! Thank-you very much.

  25. It works just fine in Windows 8.
    Just use notepad and choose to save the file as ‘All files’ instead of ‘.txt’, and have it saved on the desktop.

  26. Thanks for that! So simple yet effective.

  27. LinuXtreme says

    Great tip! I had tried changing the xml file but, like JT (June 7) said, no luck there.

    As mentioned by so many others, when I tried simply selecting a song in iTunes I got the error but having a track playing enabled the tool to work its magic.

    I’m notoriously anal about my playcount matching for an entire album. I recently re-ripped one of my CD’s so this was a welcome fix hack! Now I can re-rip the rest of my collection with no regret…

  28. Thank you! i had 14 too many plays on 12 songs so this helped a lot!

  29. jerkyhunter says

    If you are ever in, say, jail and need bail money? E-mail me. I owe ya. P: thankyouthankyouthankyouthankyouthankyou

  30. Jonathan Chapman says

    It says can’t create object name itunes application seems I’m the only one it hasn’t worked for

  31. If you are still having errors with Windows 8 make sure you are running wscript as Administrator. Put the code below at the beginning of the script. At the end of the whole script add a fourth “End If” statement.

    Set WshShell = WScript.CreateObject(“WScript.Shell”)
    If WScript.Arguments.length = 0 Then
    Set ObjShell = CreateObject(“Shell.Application”)
    ObjShell.ShellExecute “wscript.exe”, “””” & _
    WScript.ScriptFullName & “””” &_
    ” RunAsAdministrator”, , “runas”, 1

  32. Works perfectly! Win8 x64 iTunes

  33. This is great! It’s been very helpful changing my play count!

  34. This works on me using Win8 Pro 64-bit, using iTunes

  35. As someone that is extremely obsessive with their iTunes library, this helped me out EXTREMELY when I got a new computer and lost my entire iTunes library. Massive thanks!

  36. OMG THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

  37. It’s a really great little programme! Very helpful.

    But ever since I updated to iTunes it doesn’t work anymore :(… I already altered my SetPlayCount with the extra couple of lines Ryan mentioned on January 30th. I still get the following warning:

    It says it can’t find iTunes.Application
    Code: 80020009
    Source: WScript.CreateObject

  38. Wow it actually worked

  39. It didn’t work for me, said the track couldn’t be modified.

  40. How can I make this work on my Macbook???

  41. benvoliothefirst says

    Thanks so much, does exactly what it says on the tin. Perfect little applet that does something that should be built into iTunes to begin with.

  42. Thank you man. It worked.

  43. KnifeFight says

    This is f’ing awesome! THANK YOU!!!

  44. Thaks sooooo muuuch!! Awsome tip:bd

  45. Thanks a lot! The script works like charm with my iTune v12.0.1.26.

  46. Darryl Edwards says

    Works absolutely great, just follow the instructions exactly. I made the mistake of creating a new notepad file first, and then trying to save as SetPlayCount.vbs which didn’t work. You have to open NotePad, paste the text in and then save as SetPlayCount.vbs (select “all files” in the “Save as type” drop down.

  47. Darryl Edwards says

    In addition to my last comment, I actually prefer this code which lets you change the current iTunes track selected, rather than having to change the track that’s currently playing in iTunes. This way, I can listen to my iTunes whilst still editing Play Counts :). See the code below:

    Dim iTunesApp, selectedTracks, newPlayCount
    Dim prompt, title, defaultValue

    Set iTunesApp = WScript.CreateObject(“iTunes.Application”)
    Set selectedTracks = iTunesApp.SelectedTracks

    prompt = “New playcount:”

    For Each IITTrack In selectedTracks
    title = IITTrack.Artist & ” – ” & IITTrack.Name
    defaultValue = IITTrack.PlayedCount
    newPlayCount = InputBox (prompt, title, defaultValue)

    ‘MsgBox(“NewPlayCount = ” & newPlayCount)

    If Len(newPlayCount) > 0 Then
    If IsNumeric(newPlayCount) Then
    If newPlayCount >= 0 Then
    IITTrack.PlayedCount = newPlayCount
    End If
    End If
    Exit For
    End If

  48. Michael S. says

    Love it! Though time consuming I was able to change the play count for over 700 songs. I’m going to play with the code in VB6 and see if I can streamline and accelerate the process in one shot by loading in a text file containing the desired data.

Speak Your Mind