• Please review our updated Terms and Rules here

HELP: Programming

Yzzerdd

Veteran Member
Joined
Oct 20, 2006
Messages
1,292
Location
Boston, MA
OK, so I have a new project for this weekend. A teacher asked me to put typing programs from 5.25 to 3.5 disks; thats the easy part. I planned to format/s the 3.5 disk, so it was bootable, and put both programs on it. Now here is the tricky part: Instead of having to type the name of the program, I want to put in an autoexec.bat file, which automatically brings you to a screen reading "Which program would you like to run? A: Mavis Beacon B: MasterType" but in an organized fashion. Then, if you press "A" it executes a batch file with information to automatically start program A, and the same for "B." Is there any way I can do this? Perhaps using programming, such as GWBASIC or even QBASIC?

Thanks in advanced

--Ryan
 
Just use a DOS batch file:

Code:
Copy con autoexec.bat<enter>

echo Which Program

1). Mavis Beacon

2). Master Type

echo off<ctrl-z>

Then you'll need to rename each program accordingly:
Code:
ren 1 mavis*.*
ren 2 mast*.*

Am I forgetting anything? Anyone?? (It's been a while).

--T
 
I suppose you will execute this batch file in some relatively ancient DOS version, like MS-DOS 6.22 or preferrably older? I think what you want to do is to build a menu with the CHOICE command:

Code:
@ECHO OFF
ECHO "1 - MAVIS BEACON"
ECHO "2 - MASTERTYPE"
CHOICE /C:12
 
IF errorlevel 2 GOTO mtype
 
:beacon
(insert command to execute Mavis Beacon)
EXIT (perhaps not required)
 
:mtype
(ditto, but for MasterType)

This example was modelled after this page:
http://home.att.net/~gobruen/progs/dos_batch/dos_batch.html

I don't know if you can also use choices A, B, C instead of numbers, but it is worth a try. Of course you can write your own menu software in e.g. Basic, but scripting should pretty much be all you need to do in this simple case.
 
lol. My dad did that for us when we were kids with our game disks on the Zenith.

Yeah, you name the batch file that calls the regular program 1.bat, 2.bat, etc and in autoexec you'd put (at the end)

@echo off
echo "Which game would you like to play? (1, 2)"
echo "1.) Game A"
echo "2.) Game B"


Then it leaves them at a normal dos prompt. If they type 1 and press enter that will run your 1.bat which just needs the path of the program to run:
1.bat = a:\bla\mavis.exe

- John
 
DOS menu

DOS menu

Oops; I was referring to the first response, the rest slipped in
while I was typing.

Lotsa ways to skin a cat (metaphorically speaking, in case any PETA
folks are reading ;-)

m
 
Back
Top