View Full Version : HELP: Programming
Yzzerdd
October 12th, 2007, 07:53 AM
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
Terry Yager
October 12th, 2007, 08:43 AM
Just use a DOS batch file:
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:
ren 1 mavis*.*
ren 2 mast*.*
Am I forgetting anything? Anyone?? (It's been a while).
--T
carlsson
October 12th, 2007, 08:51 AM
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:
@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.
barythrin
October 12th, 2007, 08:53 AM
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
MikeS
October 12th, 2007, 08:56 AM
That's one way, although that's not how you'd ren the files (and you'd
definitely only want to ren the main file of each app.
There are better ways; for an example see:
http://http-server.carleton.ca/~dmcfet/menu.html
mike
MikeS
October 12th, 2007, 09:00 AM
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
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.