Page 1 of 1

Prevent console crash

Posted: 28 Jun 2011 23:48
by Ed Dyreen

This is the command I use to prevent the console from closing on a syntax error:

Code: Select all

start "TST_noterm" "%COMSPEC%" /k "tst.CMD"
I've noticed this is not enough, the console still crashes on a logical error.
Is there anything that can be done about this, so I don't have to guess what went wrong ?

Re: Prevent console crash

Posted: 29 Jun 2011 00:00
by nitt
I tried your code but it crashed Chrome and Folding@Home... How am I supposed to implement this?

Re: Prevent console crash

Posted: 29 Jun 2011 00:14
by Ed Dyreen

It's a question nitt, not an implementation. This works for XP:

Code: Select all

start "Title" "%COMSPEC%" /k "mybatch.???"
I simply start a new instance of cmd with the stay resident option /k, see cmd /? for help.
But the console still crashes on a logical error :(

Re: Prevent console crash

Posted: 04 Jul 2011 08:55
by orange_batch
Can you give an example of a logical error?

Re: Prevent console crash

Posted: 04 Jul 2011 16:23
by Ed Dyreen

I mean like buffer overflow, I'm not very good in english so maybe i'm not expressing myself correctly. When using the push any string over endlocal technique with a string that is too big, the console will crash, even with the /k option :|