VOGONS


First post, by Gene Wirchenko

User metadata
Rank Member
Rank
Member

I was experimenting with starting up DOSBox to run an app and exiting. I used the -exit parameter which worked fine until I had more than one -c "<insert command here>" parameter. Then, the exit did not happen.

For a workaround, I tried removing the -exit and adding a final command of
-c "exit"
This worked.

I have also noted that from GW-BASIC, that a
command "exit"
does not terminate DOSBox as I would have expected.

Reply 1 of 3, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The -exit parameter should be used in conjunction with a program name to run on the command line, and DOSBox closes when that program exits. I suspect you were using -c parameters (which append commands to Z:\AUTOEXEC.BAT) with no program to run.

The behavior of the "exit" command issued from the running BASIC interpreter is to be expected, because you're exiting the sub-shell created by the interpreter to execute the command. DOSBox only closes from an "exit" command when the top level shell is exited.

Reply 2 of 3, by IIGS_User

User metadata
Rank Oldbie
Rank
Oldbie
Gene Wirchenko wrote:

I have also noted that from GW-BASIC, that a
command "exit"
does not terminate DOSBox as I would have expected.

True, this exits GW-BASIC, but not DOSBox itself.

Klimawandel.

Reply 3 of 3, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
IIGS_User wrote:
Gene Wirchenko wrote:

I have also noted that from GW-BASIC, that a
command "exit"
does not terminate DOSBox as I would have expected.

True, this exits GW-BASIC, but not DOSBox itself.

How do you figure? GW-BASIC is exited with the SYSTEM statement.

The normal way to execute DOS commands from within GW-BASIC is with the SHELL statement. In this case: SHELL "EXIT", which as I mentioned will only exit the sub-shell thus created, effectively doing nothing -- it does not cause GW-BASIC to be exited.