Menu

#542 "@echo off" command make "-c exit" and "-exit" option be ignored

0.74
open
nobody
None
1
2020-11-11
2020-11-11
Mathias
No

I have a game which, when launched through a command line like DOSBox.exe -c GAME.EXE -c exit will "eat" away the exit command that (DOSBox will not quit when the game is exited, same if I use -exit). It took me some time to track the cause to the start script of the game that is using an "@echo off" command. After this command execute, for some reasons passing -c exit on the DOSBox command line no longer works.

I’m pretty sure that this is also the cause of the issues in the following threads
https://www.vogons.org/viewtopic.php?f=31&t=8843
https://www.vogons.org/viewtopic.php?f=31&t=66560

Steps to reproduce:

  1. Create a test.bat file that contains the one line @echo off.
  2. On the command line, from the directory where the file was created, start DOSBox with the following command: DOSBox.exe -c "mount C ." -c "C:\TEST.BAT" -c exit (note, I tested this on Windows 10 with DOSBox 0.74-3, I don’t know if this can be reproduced on Linux and the command line might need some escaping there).

What should happen:
DOSBox starts, executes the .bat file and then exits.

What actually happens:
DOSBox starts, executes the .bat file and then does not exit.

Discussion

  • Qbix

    Qbix - 2020-11-11

    that would be correct.
    you probably want
    -c "call c:\test.bat"
    But that is kinda how DOS works, not really a quirk of DOSBox

     
  • Mathias

    Mathias - 2020-11-11

    Thanks, I’m not sure I understand why this is expected but at least the workaround is already good.

     

Log in to post a comment.

MongoDB Logo MongoDB