PDA

View Full Version : any way to do it ?



Hamid
01-17-02, 01:29 PM
hi everyone

i am tring to have several small programs runing in a cd . let say A , B , C
what i want to do which i believe need to to know some prog language, but perhaps there is simple way or suggestion.

i want , when my ready cd insert in a cd rom ( of course after burning all needed program), it automatically opens a screen and giving a choice of runing A or B or C, you know like big giant software installation cd that you can have different choices.
then after finishing the " A " or "B " or...... , it comes back to main menu , and then if you want you could choose the exit.or go to X.
regarding the language knowledge i have some background of years ago like fortran and basic and pascal , long time ago.
but i am willing to put more time.

many thanks for all you thoughts
:cool:

Norm
01-17-02, 02:38 PM
You can do that using a batch file menu. I've made a few autostart CD's just like what you're talking about, to install my favorite programs. All I needed was a simple Dos batch script menu to startup when the CD was inserted.

You need to make a file named autorun.inf in order to have the CD autostart when inserted, and it must go into the root dir of the CD when you burn it. You can make it in Notepad, then save it and rename it to autorun.inf.

eg: (of the autorun.inf file)

[autorun]
open=menu.bat

eg: (of the batch menu script)

@ECHO OFF

REM - LABEL INDICATING THE BEGINNING OF THE DOCUMENT.
:BEGIN
CLS
:START
cls
ECHO CHOOSE ONE
ECHO.
ECHO Then type the Number of Your Choice
ECHO.
ECHO 1. Start Program #1
ECHO 2. Start Program #2
ECHO 3. Start Program #3
ECHO 4. Start Program #4
ECHO 5. Start Program #5
ECHO 6 Start Program #6
ECHO 7. Start Program #7
ECHO 8. Start Program #8
ECHO 9. Exit this Menu
ECHO.
ECHO.
REM - THE BELOW LINE GIVES THE USER 9 CHOICES (DEFINED AFTER /C:)
CHOICE /N /C:123456789 Type a Number That Corresponds to the Above Choices (1 2,3,4,5 6,7,8,9)%1
REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT
IF ERRORLEVEL ==9 GOTO NINE
IF ERRORLEVEL ==8 GOTO EIGHT
IF ERRORLEVEL ==7 GOTO SEVEN
IF ERRORLEVEL ==6 GOTO SIX
IF ERRORLEVEL ==5 GOTO FIVE
IF ERRORLEVEL ==4 GOTO FOUR
IF ERRORLEVEL ==3 GOTO THREE
IF ERRORLEVEL ==2 GOTO TWO
IF ERRORLEVEL ==1 GOTO ONE
GOTO START
:NINE
cls
@exit
GOTO START
:EIGHT
START Program8.exe
GOTO START
:SEVEN
START Program7.exe
GOTO START
:SIX
START Program6.exe
GOTO START
:FIVE
START Program5.exe
GOTO START
:FOUR
START Program4.exe
GOTO START
:THREE
START Program3.exe
GOTO START
:TWO
START Program2.exe
GOTO START
:ONE
START Program1.exe
GOTO START
EXIT


This menu is just an example, you would need to edit the names in the menu, and the names of the programs install.exe file, and the path to each of them according to where they are on the CD you burn.
Possibly with your existing experience you can figure it out from here.
If you have questions, I'll try to help.

Hamid
01-17-02, 03:45 PM
i am gonna try this simple ,but sufisticated method.
the only thing that i doubt : if my cd address let say drive F but my friend does not have dirve F as a cd rom he might have drive D or X in this case will it work?
i will let you know soon...
many thanks to you norm : again ::)

Norm
01-17-02, 03:58 PM
You don't need the full path that would include the drive letter. The CD will work in any Win98 machine.

Make a folder on the CD named Programs, Make new folders inside the Programs folder for each program's files.
Just leave the autorun.inf file in the root of the CD with the menu.bat file

Small eg: (of the paths in the menu.bat file)

GOTO START
:EIGHT
START \programs\program8files\Program8.exe
GOTO START
:SEVEN
START \programs\program7files\Program7.exe
GOTO START
:SIX
START \programs\program6files\Program6.exe


Do you understand what I mean now?

Hamid
01-17-02, 04:04 PM
Ohhh ya i got it
thanks again .it should work.:cool:

Norm
01-17-02, 04:07 PM
np
If you run into trouble, let me know.

Have fun, I did :)