81Views0Replies

Author Options:

i am making a password generator for cld, and i need to know how to have cmd choose from a random set of words. thanks. Answered

here is my code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

title password generator xl
color 0a
@echo off
:suggestions
cls
echo suggestions:
echo here are suggestions for getting a good password:
echo -when it asks your name, try a 4 letter name, shorten yours, or use 1 from tv.
echo -when it gives your password, press enter until you get one with 3 numbers.
pause
goto notes

:notes
cls
echo notes:
echo --pressing enter at the end will only change the numbers, not the letters.
echo --you can get a password with up to five numbers--
echo --if you dont like your password, try again--
pause
goto prt1

:prt1
cls
echo what is your name?
set /p name=

goto prt2

:prt2
cls
echo are you a boy or a girl?
set /p gend=

if %gend% == boy goto boyy
if %gend% == girl goto girll

:girll
cls
echo favorite fruit out of these? (type letter of choice)
echo a. apple
echo b. banana
echo c. cherry
echo d. strawberry
echo e. blackberry
echo f. cranberry
echo g. lemon
echo h. lime
echo i. kiwi
echo j. raspberry
set /p fruit=

if %fruit% == a goto apple
if %fruit% == b goto banana
if %fruit% == c goto cherry
if %fruit% == d goto strawberry
if %fruit% == e goto blackberry
if %fruit% == f goto cranberry
if %fruit% == g goto lemon
if %fruit% == h goto lime
if %fruit% == i goto kiwi
if %fruit% == j goto raspberry

:boyy
cls
echo favorite fruit out of these? (type letter of choice)
echo a. apple
echo b. banana
echo c. cherry
echo d. strawberry
echo e. blackberry
echo f. cranberry
echo g. lemon
echo h. lime
echo i. kiwi
echo j. raspberry
set /p fruit=

if %fruit% == a goto apple1
if %fruit% == b goto banana1
if %fruit% == c goto cherry1
if %fruit% == d goto strawberry1
if %fruit% == e goto blackberry1
if %fruit% == f goto cranberry1
if %fruit% == g goto lemon1
if %fruit% == h goto lime1
if %fruit% == i goto kiwi1
if %fruit% == j goto raspberry1

:apple
cls
echo %name%paris%random%
pause
goto apple

:banana
cls
echo %name%nabie%random%
pause
goto banana

:cherry
cls
echo %name%rabs%random%
pause
goto cherry

:strawberry
cls
echo %name%sifty%random%
pause
goto strawberry

:blackberry
cls
echo %name%rafty%random%
pause
goto blackberry

:cranberry
cls
echo %name%risty%random%
pause
goto cranberry

:lemon
cls
echo %name%rifty%random%
pause
goto lemon

:lime
cls
echo %name%lissy%random%
pause
goto lime

:kiwi
cls
echo %name%sest%random%
pause
goto kiwi

:raspberry
cls
echo %name%bera%random%
pause
goto raspberry

:apple1
cls
echo %name%pelt%random%
pause
goto apple1

:banana1
cls
echo %name%nabe%random%
pause
goto banana1

:cherry1
cls
echo %name%rabb%random%
pause
goto cherry1

:strawberry1
cls
echo %name%sift%random%
pause
goto strawberry1

:blackberry1
cls
echo %name%raft%random%
pause
goto blackberry1

:cranberry1
cls
echo %name%rist%random%
pause
goto cranberry1

:lemon1
cls
echo %name%rift%random%
pause
goto lemon1

:lime1
cls
echo %name%rask%random%
pause
goto lime1

:kiwi1
cls
echo %name%swerv%random%
pause
goto kiwi1

:raspberry1
cls
echo %name%silge%random%
pause
goto raspberry1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

as you can see, i need to have cmd choose from a random set of names for each fruit. because i dont want it to be the same every time
and i want this to be my ultimate batch program!!

Discussions