Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > The IT Pro > Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Programming A discussion forum for programs and programming used in tech-related businesses.

Reply
 
LinkBack Thread Tools
Old 10-06-2008, 12:48 PM   #1 (permalink)
Registered User
 
BestyTech's Avatar
 
Join Date: Jul 2008
Location: Leicester
Posts: 60
OS: Windows XP


Question More than 1-10 in batch???

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
__________________
/Never to young to tamper\
|--------Besty-Tech--------|
|------------The------------|
\______Teenage Tech______/
BestyTech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 10-06-2008, 11:19 PM   #2 (permalink)
Tech Hardware Team
 
Stu_computer's Avatar
 
Join Date: Jul 2005
Posts: 1,459
OS: Windows


Re: More than 1-10 in batch???

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
__________________
Stu_computer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-07-2008, 11:11 AM   #3 (permalink)
Registered User
 
BestyTech's Avatar
 
Join Date: Jul 2008
Location: Leicester
Posts: 60
OS: Windows XP


Re: More than 1-10 in batch???

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
__________________
/Never to young to tamper\
|--------Besty-Tech--------|
|------------The------------|
\______Teenage Tech______/
BestyTech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-08-2008, 09:04 PM   #4 (permalink)
Tech Hardware Team
 
Stu_computer's Avatar
 
Join Date: Jul 2005
Posts: 1,459
OS: Windows


Re: More than 1-10 in batch???

Quote:
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.}

autorun.jpg 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).
__________________

Last edited by Stu_computer; 10-08-2008 at 09:06 PM.
Stu_computer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 05:34 PM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85