Solved Jump to random sections

February 17, 2012 at 05:23:31
Specs: Windows 7
I need to jump to random sections to reduce the number of the same names created in each system.
E.g
Sometimes it will go to a, b or c.
:A
echo. Lauren
pause
:B
echo. Anni
pause
:C
echo. Joe
pause

See More: Jump to random sections

Report •

#1
February 17, 2012 at 17:55:11
✔ Best Answer
@echo off
set /a randnum=%random% %% 3
set /a randnum+=1
if %randnum%==1 goto A
if %randnum%==2 goto B
if %randnum%==3 goto C
:A
echo Lauren
pause
goto EOF
:B
echo Anni
pause
goto EOF
:C
echo Joe
pause
:EOF

Report •

#2
February 18, 2012 at 02:23:43
Just tested and it works. Appreciate it.

Report •
Related Solutions


Ask Question