jeudi 16 mars 2017

Batch random number add or subtract value

I was trying something new in batch files, and started testing with randomly generated numbers. the only problem that i got is adding values after i got the randomly generated numbers. For instance, i would like to add 300 to a randomly generated number, then how do i do this? This is what i have:

cls
@echo off
set /a KNW=%RANDOM% %%101
echo Knowledge: %KNW%
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~
%KNW%+300
echo %KNW%
PAUSE
EXIT

IMG: This is my result, i hope someone could help me.




Aucun commentaire:

Enregistrer un commentaire