Page 1 of 1
DOS bootdisk - qbasic menu
Posted: Tue Nov 02, 2004 10:05 pm
by Anonymous
Im not sure if qbasic is what i should be using for this. I want to make a network bootdisk that will give you choice as to what NIC card you have. I just need the program to run my menu. Then it needs to run a few dos files. I just dont know how to make a qbasic program run a dos file. what would be the code to run dos files from a qbasic program?
example IF NIC% = 1 THEN (HERES WHERE I NEED IT TO RUN A .COM OR .EXE FILE)
thanks
Posted: Wed Nov 03, 2004 10:38 pm
by Travesty
If all you're asking is how to run a DOS application from QBasic, then pretty much the only thing you need to know about is the SHELL command.
Syntax:
Example:
Alternatively, you could consider creating a batch file (*.bat) instead... To do so, open up your favorite simple text editor (Notepad, preferably) and type in the following psuedo-code:
Code: Select all
@ECHO OFF
ECHO Running MyApp...
C:\MyApp.Exe
...And then save it with a .BAT extention. The file will execute the same way that an .EXE or .COM file would. However, if what you need is more than just executing a DOS application (or the other few things that a batch file can do), then I wouldn't recommend this method at all. Of course, you could always combine both methods, as well:
- Create a batch file that displays some common text & runs a program
- Open QBasic
- Wherever within your program that you need to, type in the psuedo-code: SHELL "C:\MyApp.bat"
Your QBasic application will wait until all dos commands within your batch file are completed before execution returns to you, and then the execution will resume on the line following the SHELL command.