If you ever need to get a random number while writing a Windows batch script, you can use Windows command's handy little %RANDOM% environment variable.
And if you want to generate a random number within a range of values, all you have to do is perform some simple command line math. Say you want to generate a random number between 50 and 150.
set /A RN=%RANDOM% % %RANGE% + %MIN%
That should do it.