Random Number Generator in Batch/CMD

by MihaiPopa9 in Design > Software

43 Views, 0 Favorites, 0 Comments

Random Number Generator in Batch/CMD

Untitled.png

How to create a random number generator! Just in Windows Batch

Supplies

Any Windows OS that has CMD

Work for code

Code

Just code:


@echo off

:main

color 7C

title Random number generator

echo Random number generator

echo Maximum number

set /p max=Set

goto rand

:rand

set /a rand=%random% %%%max%+1

echo Your number is %rand%

echo Press any key to generate anthoer number..

pause >nul

goto main


If you don't like copying and pasting, don't worry, I have a source code file to download now!

Click on Random Number Generator Source Code.txt to download now!!

Save

Save as RNG by Mihai.bat

Or you can download the source code and rename to Random Number Generator Source Code.bat

Execute

Untitled.png

Double-click the file to execute

It asks for maximum number and it generates for you!

Done!

Done!! I created a RNG in Windows Batch!!!