Disable Ctrl-Break in DOS application

I want to disable users from breaking my macros in Accpac Plus SW. I remember long time ago there was such a trick for it, Any Ideas
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

with a different command interprter called 4dos i know u can do it using the ON BREAK

command but without that i dont know
Victor SpiridonovDatabase DirectorCommented:
put BREAK OFF line in your config.sys
BREAK=OFF ,I thought?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

nedhalAuthor Commented:
I tried it but it did not work, CTRL-Break nor CTRL-C

Morten from ElitenCommented:
Well, why not try putting the command "Break Off" in you AUTOEXEC.BAT ?

(Note that this will only work, if you're running a clean DOS, and not a Dos box, inside Windoze 95 or Windoze NT.
Set iret on int 23h !!!
nedhalAuthor Commented:
Subzero, I could not understand You, Could You PLease Explain.

iret - asm command
use int 25h for set new resident prog on int 23h which consist only iret and pusha, popa !!!
If you don't know asm - that this method not for you...that is only coders method !!!
nedhalAuthor Commented:
Adjusted points to 50


  You could use a tsr designed to do what you want, but DOS doesn't give you a way to disable CTRL+C or CTRL+BREAK checking. Is it possible to write instructions into your macro to ignore these keystrokes?

  For what it's worth, the BREAK command only controls how frequently (not whether) DOS checks for CTRL+C or CTRL+BREAK. The default setting is OFF, in which case DOS only checks during I/O to a character device- like the screen, keyboard, com port or printer. When BREAK is on, DOS also checks when reading or writing to a disk.

  The syntax for turning BREAK on in CONFIG.SYS is :


  You can also turn BREAK on and off from a batch file, or at a command prompt by typing :


  And btw, CTRL+C and CTRL+BREAK aren't the same thing; CTRL+C is processed through the keyboard buffer like any other key combo, but CTRL+BREAK uses a special interrupt mechanism, and is usually more reliable. (That may relate to what subzero was trying to say in his cute but cryptic lingo.)

  I know this doesn't solve your problem, but it explains why the BREAK suggestions didn't work. I don't know what Accpac Plus SW is, so perhaps you can post back with more info... e.g., will it run in a Windows DOS session? or only in MS-DOS mode? and are these macros specific to your program? etc...

nedhalAuthor Commented:
Ren 1010,
Accpac Plus Is an Accounting Package from CA Computer Associates. It runs under Win 95, NT and Offcourse MS-Dos.

In the Macros that is built in Accpac, there is no way to disable any keys.
How to build TSR to solve my problem


  You say what Accpac will run under, but not how you are running it... i.e., in DOS mode or in a DOS box, 95 or NT, etc... Also, is this program networked?

  You probably don't want to "build" a tsr, or anything else, unless you are well versed in some language and have a compiler, but here are some addresses of apps that might do what you want:

  For Windows, this Keyboard Remap tool, which is a control panel applet and one of the Windows 95 Kernel Toys, might do it:


  Another Windows app is at:


  If you want to load a tsr or device driver for DOS mode sessions, here are some that might work for you:




  (Description from page:)
Once either the TSR or the device driver are installed, by default pressing CTRL-C, CTRL-BREAK or CTRL-ALT-DEL will have no effect - the keystrokes are essentially discarded.  This makes DOS, many programs and batch files virtually unstoppable from the keyboard.  KEYSTOP also disables the CTRL-2 and ALT-3 (Keypad) methods of flagging CTRL-C. Any or all of these keystrokes can be re-enabled at any time using KSCONFIG.EXE.



Index page:

(Scroll down the index for this one:)
kystp110.zip    : Disables CTRL-C, CTRL-BREAK or CTRL-ALT-DEL




  And, if you really want to "build" something, this code shows how to disable CTRL-BREAK and CTRL-C using C++ :

  #include <conio.h>
  #include <dos.h>
  #include <stdlib.h>

  char far *modifiers = MK_FP(0,0x417); /* address of modifier
  flags     */
  void interrupt (*oldint9) (void);     /* storage for old INT 9
  handler */

  void interrupt myint9(void)
  /* ((*modifiers)&4)==4 indicates the CTRL key is being pressed

         inportb(0x60)==46 indicates the C key is being pressed
         inportb(0x60)==70 indicates the SCROLL LOCK/BREAK key "

         The emit code is required to clean the keypress up from

         the BIOS.

      if( (((*modifiers)&4)==4) &&
          ((inportb(0x60)==46) || (inportb(0x60)==70)) )
          __emit__(0xe4,0x61,   /* asm    IN   AL,61 */
                   0x8a,0xe0,   /* asm    MOV  AH,AL */
                   0x0c,0x80,   /* asm    OR   AL,80 */
                   0xe6,0x61,   /* asm    OUT  61,AL */
                   0x86,0xe0,   /* asm    XCHG      AL,AH */
                   0xe6,0x61,   /* asm    OUT  61,AL */
                   0xb0,0x20,   /* asm    MOV  AL,20 */
                   0xe6,0x20);  /* asm    OUT  20,AL */
  /* If the key is not CTRL-C or CTRL-BREAK, call the old INT 9
     handler */
  void exitfunc(void)
  /* Restore the old INT 9 handler */

     int i;

     oldint9=getvect(9);  /* store old interrupt vector */
     setvect(9,myint9);   /* set up new interrupt handler */
     atexit(exitfunc);    /* set up exit handler to restore INT 9*/

      /* ... */    /* code that will not CTRL-BREAK or CTRL-C */

      return 0;

People will always find a new way to bugger anything so what's to stop them from hitting reset or attempting any other malicious or ill-conceived course of action?

Tell users simply NOT to press CTRL-BREAK or else you will charge them for a service call to repair what they mess up.  Simple..and makes you money!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

 That ranks right up there with the one where the patient says to the doctor, "It hurts when I raise my arm," and the doctor replies, "Well, don't raise you arm."


I don't think that's a fair comparison.  What if his question was, "My users keep hitting the power button..." or "My users keep driving their cars off a cliff...".  At what point do you call it stupidity?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.