|I was wondering about the syntax with %random% in batch today as I have never seen it set up this way before.|
someone on another post used
%random% %% 10 to generate a random number between 1-10.
I guess I am a newbie with this kind of thing, as I thought the only way to do so was to use a set of if statements for example
set /a ran2=%random%
if /i %ran2% GTR 10 goto :ans2
if /i %ran2% LSS 1 goto :ans2
I was curious as to why this works %random% %% 10 ?
Thanks for your time.