set /a result=%random% %% 1024+1 echo %result% ::------ end snip Although this is technically incorrect since your description specified "between 1 and 1024, which would of course only include the numbers 2 thru 1023. I will assume you meant "from 1 to 1024". If this nit-picking seems anal, think about what an error like this could mean for your space-shuttle mission! Or your stock options!
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.