Update Play Count in iTunes for Windows

ITunes 12.2 Apple Music logo

Last updated on March 1st, 2022 at 09:35 am

I lost the playcount in iTunes for Windows for some of my tracks.

Tonight I wanted to fix that without editing the Library.xml file – that’s too extreme. I envy Mac owners as they have wonderful Applescript collections to manage iTunes.

I found the awesome Liquid Parallax scripts but didn’t like manually editing the javascript file to set the new play count. So I hacked it together with some Windows Script Hosting magic to invoke a input dialog box in javascript. So the script now asks you to input the new play count.

Installation instructions for Adjust Play Count in iTunes for Windows:

  1. Download AdjustPlayCount.zip and unzip the contents somewhere on your drive. This will give you a 3KB file called AdjustPlayCount.wsf
    • Google Chrome doesn’t like wsf files and may block it with the message AdjustPlayCount.zip may be dangerous so Chrome has blocked it, you can use Firefox to download it or
    • go to your address bar and enter chrome://downloads/# 
    • then click KEEP DANGEROUS FILE
  2. Remember where you saved the script.

How to Adjust Play Count in iTunes for Windows:

  1. Select/highlight one or more songs in iTunes for Windows (use Shift+click or Ctrl+click to select more than one file). This can include the song now playing.
  2. Alt+Tab to your Windows Explorer window and double-click AdjustPlayCount.wsf
  3. Enter the desired new play count number in the dialog box.
  4. Click OK
  5. The script will reply with the new play count and number of files adjusted.

The script will update your iTunes for Windows play count for all the selected songs – even for the current playing song if you’ve highlighted it.

It worked for me on Windows XP and Vista Home using iTunes 10.0.1.22, as well as Windows 7, Windows 8, and Windows 10 and iTunes 12. In the comments, you’ll see it works with lots of combinations of Windows 7, 8 and 10 with iTunes 10+.

I provide no warranties for this script. Test it on one backed-up song first. If it kills your tunes, drinks your liquor or runs off with your daughters, it’s not my fault. You’ll see in the comments it has worked with thousands of files for others.

You can open the wsf file in a text editor to read the script if you want to see what it does.

Limitations:

  1. iTunes for Windows only. It kinda needs Windows to work.
  2. AdjustPlayCount does not check or force you to type an integer in the dialog box. I don’t know what will happen, but it can’t be good.
  3. I’ve tested it with 20 songs selected. I don’t know how it would perform if you selected 1,000 songs at once. Let me know, okay? *You’ll see in the comments it’s worked with thousands of files for others.

Suggestions, bug reports, questions and/or thanks in the comments. Maybe I could make it increase the play count by set number? Tell me what you think.

Bugs

iTunes Match vs. Play Counts: Every few years it seems that iTunes Match screws with Play Counts for some users in 2011, 2014, 2016, and 2017. It looks like iTunes 12.7.114 is doing it for one user below. Actually, it is iTunes Match that stops play count sync. It seems to be random and not all users are affected. If you use iTunes Match it may affect you. Suggested temporary fixes are to deregister the PC, reboot, fix the play counts, and then register the PC. That does not mean the problem will not return.

Updates

Update 28 February 2022: Still works in 2022 with Windows 10 and iTunes 12.12.2.2

Update 10 August 2021: Still works in 2021 with Windows 10 and latest iTunes 12!

Update 10 Jun 2019: The new Apple Music.app for MacOS is scriptable, but I’ll need to update the script if Apple decides to drop iTunes for Windows in favour of a Music for Windows app. In the meantime the script still works.

Update 24 March 2017: If you can’t download the file using Google Chrome browser because of its security settings, you can use Firefox to get the file or do the following

  • go to your address bar and enter chrome://downloads/# 
  • then click KEEP DANGEROUS FILE

Update 14 April 2013: I’m thinking of a checkbox that will also reset the last played date to today’s date. Again, let me know what you think.


68 responses to “Update Play Count in iTunes for Windows”

  1. I’m gonna try this later.

    I forgot to back up my iTunes library (not music files, they’re all safe in external HDD) when I reformatted my PC so I thought I lost my playlists built for over a decade. Looks like I can rebuild again thanks to Rocket Player, listFix, m3u8 playlists to back up from my phone, and now this script.

    Godspeed.

  2. iTunes 12.5.4.42, Windows 10 x64. Updated play count on 1900 files, and on a network drive too. Many thanks!

  3. hey, I used the script and it worked but when my itunes connected to icloud laterthe play count reset to the original value. Now it keeps on resetting so my play count for those songs is broken. Anyway to undo this?

    • Hi @kenith What version of Windows and iTunes are you using?

      That way I can check it.

      It seems like you said you’re backing up/restoring iTunes to iCloud?

      I thought that was an iPhone setting in Settings>iCloud i.e. you back up your phone to iTunes or iCloud not both.

      • Hi,

        Thx for the speedy response.
        I’m using itunes version 12.7.1.14 on a Windows 7 pc. I have an itunes match subscription so itunes connects to the cloud if I’m not misstaken to upload/match new songs.

        • Yes it’s a bug on Apple’s side with iTunes Match. Doug’s AppleScripts for iTunes mentioned it last year and it was a problem Apple’s forums in 2011 and 2014 (oops!).

          There seems to be a fairly recent bug affecting track play counts or plays when the played count property of an iTunes track is changed with AppleScript. If iCloud Music Library or iTunes Match is enabled, the value will revert to what it was before being changed by AppleScript. It seems as though either the new play count for a track doesn’t get synced to the cloud or that the original value in the cloud has over-written the new plays value. Or something like that.

          Several scripts here (Multi-Item Edit, New Play Count, New Last Played Date, et al) that allow you to edit the play counts of your tracks are affected by this bug, which only occurs if you’re also using iCloud Music Library or iTunes Match. I am not sure if versions of iTunes prior to 12.3.3.17 are affected or if, perhaps, the bug also occurs with a track’s skipped count (I wouldn’t be surprised).

          I filed a bug report with Apple and it turns out it’s already an open issue, so Apple knows about it. Now we wait.

          https://dougscripts.com/itunes/2016/04/play-counts-bug/

  4. I keep getting an error message for some songs :

    Adjust iTunes Play Count Error message

    It happens only with this one particular album from a Japanese artist (artist name in Japanese characters + English, song titles all in English). Some songs work, some not.

    I’m on Windows 10 with the latest itunes.

    • That error message is because the script does not have rights to edit the metadata in the track. That metadata is embedded in the mp3. So in file browser locate the track then, right-click > properties and fix the permissions for the file.

      Another possibility is that the script is failing on the Japanese characters. Let me know if the permission fix works first. Also paste the Japanese + English file name in a comment here and I’ll test it’s handling of UTF-16 characters.

  5. You are a lifesaver — I had my counts adjusted when I had to reload damaged files (hundreds). Since I use play counts for smart playlists, this sucked. Your script worked perfectly just now in 12.9.0.167 — thank you!

  6. Still works in 2021 with Windows 10 and latest iTunes! Cheers, thanks so much for the time saved and easy instructions.

    • Great to hear. In this age of streaming I still use my song library as some of my music isn’t available on the platforms I’m subscribed to. That worries me about the long term accessibility of music that isn’t in the top 2080 pop songs per year.

  7. Seems to work In Win 11 and iTunes 12.11.4.1, except that, when I run it against a smart playlist, I sometimes get an error message at the end: Line 44, Char 6, The playlist has been deleted, Code A0040202, Source (null).

    Seemed to update the playlist counts just fine, though, and no playlists were deleted or otherwise harmed, as far as I can tell!

    • I’m surprised smart playlists work at all. But I think they just serve a list of files to the script so it works until the end of file, which doesn’t exist.

      Thanks for the feedback.

  8. Was there ever a fix for the apple music version on windows? Forced to use this unfortunately.

    • Last check was if you use the script to update your play count and Apple Music accepts the sync, you should be good.

      Guy. in case you’re monitoring the site, I’ve replied, but as you’ve put a fake email address*, you probably won’t see this.

      No need for fake email addresses on this blog as I’m not asking you to sign up for anything.

      If you tick one of the two Notify me… boxes when you leave a comment, you may get an email, though probably not as the modern internet stops most server generated emails from getting through.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.