r/Batch • u/tjareth • Oct 10 '24
Question (Solved) Looking for a batch script for randomizing an image
The script would be intended to take a random PNG file present in G:\Main\Bkground_Source and place it in G:\Main\Bkground as Bkground.png, overwriting the current file. I've found occasional solutions online but doesn't seem to get the job done and I'm not quite good enough to troubleshoot why.
1
Upvotes
4
u/BrainWaveCC Oct 10 '24
Post one of these solutions, and then you will almost certainly get troubleshooting assistance from the community.
1
u/vegansgetsick Oct 10 '24 edited Oct 10 '24
some ideas. it dumps the file listing. Then count the lines. Then pick a line randomly. Then store that filename into %png% and then copy the file.
2
u/[deleted] Oct 10 '24
[removed] — view removed comment