1.

Solve : Math functions in DOS?

Answer»

Is there a way to multiply two environment variables in DOS? I have generated two random variables that I now want to multiply to generate a LARGER random NUMBER. Thank you.DOS does not do arithmetic. However the cmd processor under Win2000 and WinXP (MAYBE even WinNT) has facilities for doing simple math.

Code: [Select]set rand1=%random%
set rand2=%random%
set /a result=%rand1%*%rand2%
ECHO %result%

8-)Perfect! Thank you very much.



Discussion

No Comment Found