Random number in MS-DOS

Profile blocked -  
 Profile blocked -
Hello,
I want to create a variable that varies between the numbers 1 and 20 in DOS.
How can I do that, please?

Configuration: Windows 7 / Firefox 3.6.13

4 answers

  1. dubcek Posted messages 18627 Registration date   Status Contributor Last intervention   5 660
     
    bonjour
    set /a x=%RANDOM%*20/32767
    0
  2. Profile blocked
     
    In fact, I think if I do set /a x=%random%*5+20 it’s good, right?
    0
  3. Profile blocked
     
    It's good, I found it: set /a x=%RANDOM%*5/32767+20
    0