|Hello all, I'm having some trouble to find a way out of this:|
I want to rename a random file in a folder (all files are numbers starting from 1, and I keep changing the quantity of files in this folder), and the code i was using worked fine, but as i change the amount of files, I had to change the code too... so I tried
for /F %%j in ('dir C:\myfolder /A-D-H /B ^| find /C /V "::"') do set Count=%%j
set /a novoBG=%random%%%%Count%.jpg
so I could use the "novoBG" as it was already working.
But I just can't find out how to get a random number up to the value on the var.
Hope anyone can help me. Thanks