Page 1 of 1

Need serious help

Posted: Tue Apr 26, 2005 6:04 am
by Telgarius
I have a computer that i store all my old dos games on. I would like to
write a program in qbasic that allows me to show all the games so i can
pick one. I know how to write this program but i cant figure how to get
it to run the certain game...can i do this or atleast make it goto the
directory where the game is? please help.

Posted: Tue Apr 26, 2005 6:50 am
by lurah-
Have you tryed "RUN" command?

Depending how much your program uses ram, it might be better to use *.bat
file?

Posted: Tue Apr 26, 2005 12:21 pm
by Michael Calkins
To change directory:
CHDIR
or
SHELL "CD\"+dirname$

To run a small game:
SHELL doscommand$

To run a large game, here is how I would do it:
Use a BAT file to run your QBASIC program. Something like this:

@echo off
:loop
if exist temp.bat del temp.bat
c:\dos\qbasic.exe /run myprog.bas
if exist temp.bat call temp.bat
if exist temp.bat goto loop

Then, have your QBASIC program write temp.bat with the command to execute your game. The advantage to this is that QBASIC.EXE is not still taking up memory.
Regards,
Michael