My first thought was to write a short Python script to rename all of the files with a random name. This seemed easy enough, but someone must've come across this issue already...
Of course, someone has created a little tool to do this. Check out this Windows batch file from Jason Faulkner on howtogeek.com.
The script is easy to use.
- Insert the USB stick with the photos on it. (I copied all of the photos to a backup folder just in case.)
- Navigate to the USB stick in a DOS window on your Windows machine. Here is a directory listing of the F: drive, which is the USB stick:
- Notice many of the files have consecutive names? This is what I want to change.
- Copy the batch file to this location (in this case F:\).
- Run the batch file. Just type "randomnames" and hit enter. This is what you should see:
- Type OK. Don't sweat it. When the script has finished, do another directory listing (type 'dir'):
Great, the photos all have random names now. I inserted the stick into the picture frame...
This didn't change the order at all! Was it the file date that needed to be changed?
With the USB stick back in my laptop, I updated the date on all of the files. The POSIX utility 'touch' could be used to do this. I used a program called ZTree to update the date on all of the files to today's date.
I tried again with updated dates. No difference. The files were still being displayed in the original order! Now, the only thing I could think of is that the files are being read at a very low level, meaning they are simply being read from the stick in the physical order they are stored there. The remedy for this is simply to move all of the files to your hard drive (either by using the move command or by copying them all and then deleting them), and then copy them back to the USB stick.
You should be able to use Windows Explorer to do this. Again, I used ZTree. Sort by name before copying back to the USB stick, and they should be copied in a 'random' order, because the names are already randomized.
Finally, it worked! The photos are now displayed in a random order. A simplified version of the steps:
- Start with a blank USB stick.
- Copy all of the photos you want to display into a temp directory on your hard drive.
- Copy the batch file "RenameFiles.bat" into the temp folder you just created.
- Execute the batch file to rename all of the files randomly.
- Use Windows Explorer and sort all of the files by name.
- Copy all of the files onto the blank USB stick.