Here is my code:
for %%i in ("joined/*.mp4") do (
set /a result=(%random%*2/32768)+1
echo %result%
)
It gives me errors about +1 was unexpected at this time
.
I tried another variant:
for %%i in ("joined/*.mp4") do (
set /a result=(%random%*2/32768)
echo %result%
)
It gives me an error about unbalanced parenthesis.
How can I echo the random variable correctly?
Thanks. :)
Trying the following code gives me the same value of random every time. How can I change it with each itertion of the loop?
setlocal EnableDelayedExpansion
for %%i in ("joined/*.mp4") do (
set /a result= %random%*20/32768 + 1
echo !result!
)
Is there a resource that I can read to learn in detail how batch files work and their language like loops, arrays etc.? I tried searching on Google but nothing useful came up.