Trying to find a way to rename only a single file at random from a target directory to 1.MP4 so that my shortcut on my desktop points to same file name but the movie played is at random each time the batch is run.
Tried a few different methods from stuff I found online, but ran into issues with them.
This one here I was thinking about using to rewrite it into a single file targeted with a test file storing its original name so that files can take on their original name when batch is run a second time.
https://www.howtogeek.com/57661/stupid-geek-tricks-randomly-rename-every-file-in-a-directory/ but this one renames all in the target directory with a random number name.
Was thinking that the best method would be one that selects a file from DIR output at random and then saves the original file name and then renames that file to 1.MP4 and then this way the shortcut at the desktop points to a random movie file and each time the batch is run the original name is written back to the last file that was named 1.MP4 and another file at random taken and renamed as 1.MP4 in the target location. However at a loss on how to get the random selection of a file name from DIR output or maybe there is a better method to use to achieve this other than a random generator that the number output maximum random value is equal to file count from DIR and some other means of selecting a file at random to be renamed as 1.MP4
Geek-9PM's MP3 prepend project had me thinking about a random selection for movies and that a movie of a static name that a shortcut name doesnt change but the file itself can change its contents as a means of random movie viewing from a shortcut on desktop.
Earlier tonight I gutted the batch from the link above to rename all files in a target to number names, but that creates all sorts of problems such as if the random generator chose the same number more than once before the batch ends iterations, then files can be deleted by 2 files give the same name where the last rename overwrites the prior file contents.
Other issue I ran into was setting the min-max random values the min/max parameters were writing to the name when when setting the random min max to a variable and then calling to variable as !number!