Home > other >  DOS command, for the difference between variable and global variables inside, % and! The difference
DOS command, for the difference between variable and global variables inside, % and! The difference

Time:01-08

The random set/a RandomNumber=% % % % 100 + 1
: : 100 is a range, number 1 is a base that is from the beginning. (use) in bat, will go wrong in the CMD.
: : take random double-digit
Set/a random: d=% % ~ 0, 2
Echo % d %
: : avoid 00
The set/a e=1% random: % ~ 0, 2-100
Echo % e % @ echo off
: loop
The set/a RandomNumber=random: 1% - 1% % random: - 1% - 99
: : a maximum of 100
If % % RandomNumber LSS 35 goto loop
: : less than 35 return
If % % RandomNumber GTR 75 goto loop
: over 75 return:
Echo RandomNumber % %
If "% RandomNumber %==" "50" pause
Goto loop