Add random numbers to media file names

June 28, 2021

The entertainment system in our Mazda CX-5 (purchased in 2017) doesn’t understand the meaning of ‘random play’. Too many times we’ll only get tracks from artist A and H, with the occasional track from artist P thrown in. Next time we start the car, we might get artists C, G, and W, but no-one else for ages or at all. It certainly isn’t ‘random’ when there are thousands of tracks and artists to choose from, yet you get similar patterns of not-very-random rotation.

A while back I searched for a reason why and how to get it to be properly random, but to no avail. On a recent long drive, it annoyed the hell out of me, so I mentioned it at lunch with a techie friend and he said there could be a limit to the number of files the system treats as random (in his car, it was 999). He solved the problem by writing a program that allocated random numbers to all the file names, then set up playlists of no more than 999 tracks. Because the numbers were random, his playlists were all random tracks, which is what he wanted. In his car’s entertainment system, he sets it to play playlists, not random, and he said that’s the key to getting a truly random order.

Armed with that knowledge I went searching again to find out if there was a limit in the Mazda’s system. I found several mentions on forums of limits of 199, 255, and others who said no limits to the number of files. However, this webpage (http://www.mcx5.org/operating_tips_for_audio_system-107.html) suggests that there’s a limit of 255 files in a folder that the system will take notice of (for indexing purposes?) and will ignore the rest. And possibly a limit of 512 folders. And on one forum, someone mentioned that they used the free MediaMonkey for Windows software (https://www.mediamonkey.com/) to randomise the files then saved them to playlists, as my friend has done. One added that you can also use MediaMonkey to permanently add a random number to the file names for each track. That looked promising!

I downloaded MediaMonkey and checked out some different ways you can use it to organise your music (yes, I used a laptop to test on, and a bundle of some 1560 music files, totally about 13 GB—I certainly didn’t want to test it on the USB stick of music files we use in the car, just in case something went wrong). You can use MediaMonkey for all sorts of things, including as a substitute for Windows Media Player etc., but my main purpose was to test out the randomisation and file renaming. NOTE: I only spent a couple of hours testing a specific thing, so I am NOT an expert on MediaMonkey by anyone’s stretch of the imagination.

Once you’ve told MediaMonkey where your music files are, it will load them into its library. All tracks loaded will be listed under Music > All Tracks and also under Playlists > Accessible tracks. From there you can one or many, or select them all (click on one track, then press Ctrl+A), and then re-organise them into smaller subsets, randomise them, and/or apply random numbers to each track. You can do lots lots more, but these are what I focused on and what I discuss below.

Before you start, I strongly suggest that you create new folders/subfolders for the randomly numbered tracks and/or playlists you’ll create. I couldn’t see any way of adding new folders while I was in the move/copy mode. The subfolders I created had names like Random01, Random02, etc. For playlists by genre, I created Country01, Country02, Classical01, Rock01, Rock02, 60s70s, etc. You do what suits you.

Note: You can use one or both methods below, depending on how you want to organise your music. Click on the screenshots to see them in a larger format.

Add a random number to each track

  1. Select all the tracks you want to randomise.
  2. Go to Tools > Auto-organise Files.
  3. Select either Move or Copy (Copy leaves your original files intact, so I chose that).
  4. Click Configure to open the Destination window.
  5. Click Browse and select the drive, folder, subfolder where you want to copy the files to. Click OK.
  6. In the Filenames field, type the order of the ‘masks’ you want to apply. By default, the order is <Title> – <Artist>, but I wanted a 5-digit random number added before the title, so I typed <Random:5> then a space and left the remainder. (If you wanted a 4-digit number, you’d type 4, or leave off the colon and number for a number of any size, presumably limited by the maximum number of files you have, though I can’t confirm that)
  7. Click OK to return to the Auto organise window, where the old path and new file paths are shown for each selected track, including the new random numbers; in my case, I added these before the title and artist. Check these paths are correct, that the destination is correct, and that you’ve selected either Move (the default) or Copy.
  8. If all is correct, click OK. Depending on the number of files you have, this could take seconds to minutes, perhaps hours if you have a HUGE music library. For my 13 GB of 1560 files, it took a few minutes.
  9. Go to the folder you moved or copied the newly named files to and check that you got the result you were hoping for.

Put a defined number of randomised tracks into a playlist for the car

There are two methods for doing this—one is to copy/paste the required number from the randomised numbered list of tracks in the folder (as above), as many times as you need, into other subfolders. I won’t describe how to do this.

The other uses MediaMonkey, where you can define the maximum number of tracks per playlist, set genres etc. Again, my advice is to create your folders/subfolders first.

  1. Go to Playlists > Accessible tracks. Select as many (or all) tracks you want to randomise and to allocate to a defined set of tracks. You can select far more than you need (I selected all 1560 to create playlists of 255 tracks).
  2. Go to Edit > New Auto Playlist.
  3. Set the parameters for your playlist:
    • By default the name is New AutoPlaylist – click in that name to change it to what you want (I changed mine to 60s 70s)
    • Limit the search, as required (I didn’t)
    • Match the specified criteria – click the + sign to add criteria. In the screenshot below, you can see I added Date as a criteria and changed the value to be before or equal to 1 Jan 1980. (Note: these criteria work on the metadata of the files, so you need to have that metadata before the criteria limits will work; I won’t address that in this post)
    • Check the box for Limit, and enter the number of tracks to limit the playlist too. You can see I’ve limited mine to 255 tracks.
    • For Selected By, I clicked the drop-down arrow and selected Random track (auto refresh).
  4. Each time you limit the criteria in the section near the top of the screen, the list automatically refreshes to match those criteria. In my case, of the 1560 tracks I had only 243 meet my criteria, so even though I had a 255 maximum limit, only those 243 tracks would go into this 60s and 70s playlist. Bonus: You get told how much space these tracks will take (handy if you have a size limit on an older USB stick), and how long the combined play time will be (in this case, nearly 17 hours)
  5. Once you have your playlist, you can right-click on the playlist title in the left panel, then select Send To and navigate to the folder where you want to store the files (locally, USB stick for the car, etc.).  NOTE: If you used the random number function detailed earlier, AND randomised this playlist, you may end up with the same playlist with double entries—some with numbers at the beginning of the file, some without. Using Windows Explorer, just delete those you don’t need from the subfolder.

[Links last checked June 2021]


  1. Thanks for this great article Rhonda!

    I’m sure you’ve written about this but I’m too lazy to look for it. What can I do with a Word file that will not open? I guess it’s corrupted somehow. I was working for several hours on it and saving periodically, but then had some issues with Windows Explorer not working so I had to fix that and when I got it fixed and rebooted the system, the Word file will not open now. I get this error message: “Word experienced an error trying to open the file. Try these suggestions. * Check the file permissions for the document or drive. * Make sure there is sufficient free memory and disk space. * Open the file with the Text Recovery converter. (D:\…725-AirDB v8x – AirPlan v8x …)”

    File permissions are: Full Control

    Free Memory: ?

    Disk Space: 745GB free

    What is the “Text Recovery Converter”?

    Thanks, Matt.

  2. Hi Matt

    You could try some of these (https://cybertext.wordpress.com/2012/07/20/microsoft-word-crashes-recovery-options/), but it looks like the doc won’t even open. I suggest you make a copy of it, then try to open the copy in Wordpad (which should be on your Windows PC by default; in Explorer, right click on the file and select Open With, then select Wordpad). Another suggestion is to upload the doc to Google Docs and try to open from there. Or download the free Open Office and try that. Your aim at the moment is to preserve the text you have in the doc — you can reapply formatting later if some of it goes wonky. If you can get it open in one of these apps, you can try saving as a new DOCX file and trying to reopen in Word. If that doesn’t work, you can try saving as an RTF file and then try opening in Word.

    And at that point, I’m out of suggestions!


  3. Matt: I’ve now written a new blog post dealing with your issues: https://cybertext.wordpress.com/2021/06/29/word-has-errors-and-wont-open/


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: