Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#393 DosBox hangs on infinite loops in batch files

0.74
open
nobody
None
1
2013-04-27
2013-04-27
No

If an error (possibly a programming error) results in an infinite loop in a batch file, DosBox hangs.

Sample code illustrating the problem

:ChooseOperation
echo F - OperationF
echo A - OperationA
echo E - OperationE
echo C - OperationC
echo Q - Quit
@rem choize is an equivalent of choice.com (or a renamed choice.com)
@rem if it's not found in the current directory or in %PATH%,
@rem DosBox enters an infinite loop
choize /C:FAECQ Choose operation
if errorlevel 5 goto OperationQ
if errorlevel 4 goto OperationC
if errorlevel 3 goto OperationE
if errorlevel 2 goto OperationA
if errorlevel 1 goto OperationF
goto ChooseOperation

:OperationC
@rem fcom is an equivalent of Norton Commander
@rem and it can change the current directory,
@rem possibly causing choize being not found in the new current
@rem directory and if choize can't be found via %PATH%, DosBox
@rem starts looping infinitely
c:\fcom\fcom
goto ChooseOperation

:OperationF
:OperationA
:OperationE
:OperationQ

Discussion

  • And there doesn't seem to be a way to abort execution of a batch file with an infinite loop like this other than by terminating DosBox.