I want to generate a random number for a random part in my batch file.

I want to generate a random number between x and y which I can change anytime.

max & min inclusive: rem max must be geq min rem min must be geq 0 rem max must be leq 32767 set min=1 set max=9 set /a var=(%random% %% ((max - min) + 1 )) + min echo %var% pause

Thanks.

Ask Your Question

Weekly Poll

Do older people you know use the Internet?

Discuss in The Lounge

Poll History