# More than 1-10 in batch???



## BestyTech (Jul 18, 2008)

Hi im kinda new to batch commands and i am trying to make a easy to use installer that users can use to install things easly..

so far i have made it so they can choose from a list what they want using the numbers 1-9 but how can i have it so they can type 11 and it goto choice 11 and not 1??


@ECHO off
cls
:start
CLS
ECHO Please Choose What You Wish To Install. (Press Number Keys)
ECHO ............................................................
ECHO 1. Music Match Jukebox
ECHO 2. other
ECHO 3. something els


set choice=
set /p choice=I wish to install option 
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto musicmatch
if '%choice%'=='2' goto bye
if '%choice%'=='3' goto test
*[I WANT TO ADD HIGHER THAN 9 HERE LIKE UP TO 20]*
ECHO "%choice%" is not valid please try again
ECHO.
goto start



:musicmatch
CLS
ECHO This will now install Music Match Jukebox
Pause
CLS
Start \Setup.exe
ECHO Starting installer...



:bye
CLS
ECHO BYE
goto end


:test
CLS
ECHO TEST
goto end

:end
ECHO DONE

Pause


----------



## Stu_computer (Jul 7, 2005)

Hi Besty, are you making a custom CD or executable archive?
Do you know there is freeware that can do this?
You can make your own custom GUI with pictures or buttons instead of a batch file.

Anyway, here's your answer...

set /a counter=0
set choice=
set /p choice=I wish to install option: 
set /a counter= %counter%+%choice%
if %counter% ==1 (goto :musicmatch)
if %counter% ==2 (goto :bye)
if %counter% ==3 (goto :test)
if %counter% ==4 (goto :test)
if %counter% ==5 (goto :test)
if %counter% ==6 (goto :test)
if %counter% ==7 (goto :test)
if %counter% ==8 (goto :test)
if %counter% ==9 (goto :test)
if %counter% ==10 (goto :works)
if %counter% ==11 (goto :end)

ECHO.
ECHO "%choice%" is not valid...please try again
pause
goto :start


----------



## BestyTech (Jul 18, 2008)

Oh I see you use a counter rather than choice.


and what programs do you know of because i am trying to make a cd that when you pop it in the cd will load the batch file and give you the options to install different programs.

i know that a exe would be better but im not that advanced in programing and i found batch to be easy XD


----------



## Stu_computer (Jul 7, 2005)

> Oh I see you use a counter rather than choice


I just used the word counter but it doesn't matter, can use fred=0 or whatever, it's the set /a assignment that is important.
-------------------------------------------------

I have used DeepBurner (freeware) for years to burn CD/DVD's because I've never had any problems with it. (Threw away too many bad burns trying other more popular software.)
It can make an autorun menu and you can customize the background and buttons with your own.

On the download page there are two freeware choices:
DeepBurner Free 1.9
DeepBurner Free 1.9 (portable edition) {This version can be put on a usb stick so you can use it on any computer.}







Sample of autorun menu made with deepburner, for the background I selected custom and used a bmp file-it will be shown at actual size, so resize if necessary before selecting it. I used the default buttons for menu selections and made the exit button instead of using the defaultexit.
{note: the blue border is my desktop, not part of the menu.}
--------------------------------------------------
An even more versatile presentation can be made by using a HTML file for the autorun (loads in a browser like a web page). Since it's like any web page you can do audio, video, images, versatile text for your descriptions, etc... your imagination is the limit.

Use an HTML editor to make your page and then use something like AutorunCD Assistant or CIS Smart CD-Menu Creator to launch it in your CD. CIS Smart CD-Menu Creator also makes simple menus so you can do more than just launch the HTML.
-------------------------------------------------

Quick Menu Builder also makes nice customized menus that can be put on CD or used from a folder, though I haven't used it on any windows version newer than Win98 (never got it to install properly on win2000-though all menus made on w98 transfered to w2k worked okay).


----------

