Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: Flightfanatic on October 22, 2007, 09:48:05 AM



Title: Run command
Post by: Flightfanatic on October 22, 2007, 09:48:05 AM
What is the command in qbasic to run a file?


Title: Re: Run command
Post by: wildcard on October 22, 2007, 09:58:16 AM
If you want to run another .BAS file you can use the RUN statement - http://qbasicnews.com/qboho/qckrun.shtml or CHAIN statement - http://qbasicnews.com/qboho/qckchain.shtml
If you want to run another file using the Operating System (.EXE/.BATs/etc) you can use the SHELL statement - http://qbasicnews.com/qboho/qckshell.shtml

It all depends on what you want to do and how.


Title: Re: Run command
Post by: Mac on October 22, 2007, 03:23:18 PM

Good answer!

The only thing I would add is it sometimes necessary to add CMD /c

SHELL "cmd /c xxxxxxx"

where xxxxxx is the command that you are running via SHELL and it is not running correctly because QBasic invokes the COMMAND.EXE rather than the CMD.EXE that you are probably used to.

Mac