Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!usc!csun!srhqla!tcm From: tcm@srhqla.UUCP (Tim Meighan) Newsgroups: comp.sys.ibm.pc Subject: Re: How can I disable Control-C ? Keywords: ESC, BREAK Message-ID: <682@srhqla.UUCP> Date: 9 Jun 89 19:06:22 GMT Reply-To: tcm@srhqla.UUCP (Tim Meighan) Organization: Silent Radio, Los Angeles Lines: 32 In article <231@mipos3.intel.com> esulzner@cadev4.UUCP (Eric Sulzner ~) writes: > >If you have ANSI.SYS loaded, you can use 'ESC[3;255p' to reassign >^C (3) to null (255). 'ESC[3;3p' should put it back. This will >work from a .bat file. The ESC is ASCII 27 (decimal). An easy way to get DOS to ingest the strings above from an AUTOEXEC.BAT file is to use them as the argument of a PROMPT command: PROMPT $e[3;255p PROMPT changes $e to an ESC ($1B) code for you, so you don't have to fudge around with trying to enter a real $1B in a text string, which can be a pain. The problem with this method is that it does NOT disable the BREAK key; the BREAK key is not reassignable using ANSI.SYS escape sequences. The only sure way to shut off both CTRL-C and CTRL-BREAK is to redirect the BREAK interrupt vector. This can be done using DOS function calls. You have to write a simple COM program using DEBUG to point the BREAK interrupt vector at a FAR RET instruction. Then, you run this program from the first line of your AUTOEXEC, and your computer becomes un-stoppable. I'll dig out the source code that I wrote to do this and post it in a couple of days. BTW, The BREAK OFF command does NOT disable BREAK; it merely reduces how often DOS checks the keyboard to see if the BREAK key has been pressed. Just another example of misleading syntax from Microsoft. (On the other hand, how many OS's have YOU written lately?) Tim Meighan SilentRadio