Page 1 of 1

How do I call or run a separate executable on a QB program?

Posted: Sun Feb 05, 2012 5:16 pm
by PunkMaister
It's been a long while and I can't remember how.

It's to call or run a separate non QB based executable as an alternative in a small menu program I'm writing to complement a batch file used to run the gamw Redneck Rampage under DOSBox I want that when one exits the game for the user to have the option to either exit DOSBox entirely or to run the game's setup program if modifying the sounds/controls etc. is needed. Any help would be greatly appreciated thanks!

Posted: Sun Feb 05, 2012 6:21 pm
by burger2227
You can use SHELL "program.exe" to run another program or batch file.

If the program has command line options you can include them too!

SHELL "cmd /c start min Notepad /p textfile.txt" 'would print a text file

MIN minimizes and MAX maximizes the Notepad window.


If your program uses graphic SCREEN modes you will have to change screen modes with SCREEN 0 and back to the graphic mode or Qbasic may freeze.

SCREEN 0
SHELL
SCREEN 12


It would not be advisable to exit DosBox from a Qbasic program as it is using it to run in the first place.

Posted: Sun Feb 05, 2012 6:55 pm
by PunkMaister
Shell! I knew there was a command as I said I could not remember which Thanks a bunch! :D