First 500 is one thing next 500 the same and RANDOM 500 is extremely stupid.
I can imagine scenarios like... you get the data in one folder in the group of files that have the same prefix like
Group1 - File001
Group1 - File002
.....
Group1 - File500
Group2 - File001
...
Group2 - File500
So, the mentioned procedure can be used to access eatch group, althouh there are clearly better ways to do it, I can understand that somebody might think in that direction.
Random access doesn't have any real value. One may wan to choose a random file to do something with it, like set the picture as wallpaper but then, it is out of domain of File Managers and simple scripts can be created to do that, similar to Hackers answer above.
----
The code above is AutoHotkey code. You need to have AutoHotKey.exe to execute it. The scripting language is in question, similar to VB/JSScript.
----
SCNR

If the boy is making fun of you, you make the fun of him and give him to do that as a homework
2 icfu
Location: Kibibyte City
ROTFLMAO.... I said that X*** is great source of fun, didn't I
..hm... I guess I didn't, so here it is:
- X**** is great source of fun, isn't he ?