Both Linux Bash and Windows DOS support random number generation. The random number is ‘stored’ in a system environment variable named “RANDOM” (I believe this variable links to a script to generate the actual random numbers on both systems), use it in the same way as you use other ENV variables.  E.g.

On Linux:

1
echo $RANDOM

;

On Windows:

1
echo %RANDOM%

;