Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 691
  • Last Modified:

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
0
nedhal
Asked:
nedhal
  • 4
  • 3
  • 2
  • +5
1 Solution
 
the_q58Commented:
with a different command interprter called 4dos i know u can do it using the ON BREAK

command but without that i dont know
0
 
Victor SpiridonovCommented:
put BREAK OFF line in your config.sys
0
 
ViperOneCommented:
BREAK=OFF ,I thought?
Simon
0
Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

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


0
 
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.
0
 
SubzeroCommented:
Set iret on int 23h !!!
0
 
nedhalAuthor Commented:
Subzero, I could not understand You, Could You PLease Explain.


0
 
SubzeroCommented:
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 !!!
0
 
nedhalAuthor Commented:
Adjusted points to 50
0
 
rin1010Commented:

  Nedhal,

  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 :

  BREAK=ON

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

  BREAK ON  or  BREAK OFF

  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...

0
 
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
Regards
0
 
rin1010Commented:

  Nedhal,

  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:

http://www.microsoft.com/windows/downloads/bin/W95keyremap.exe

  Another Windows app is at:

http://www.phord.com/keyblock.html

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

http://www.uni-paderborn.de/~tomtom/simtel/msdos_keyboard_.html

  or

http://ftp.urz.uni-heidelberg.de/inline/index/ftp/pub/msdos/simtel/keyboard/kystp110.zip/

  (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.

  or

http://ftp.unicamp.br/pub/simtelnet/msdos/keyboard/

Index page:
http://ftp.unicamp.br/pub/simtelnet/msdos/keyboard/00_index.txt

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

  or

http://www.bsoftware.com/cgi-bin/fetch.cgi?ProductID=11869,Version=2

  Description:
TSR eliminates CTRL-ALT-DEL/CTRL-C/CTRL-BREAK

  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 */
      else
  /* If the key is not CTRL-C or CTRL-BREAK, call the old INT 9
     handler */
     oldint9();
  }
  void exitfunc(void)
  {
  /* Restore the old INT 9 handler */
      setvect(9,oldint9);
  }

  main()
  {
     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;
  }
 
 

0
 
patedmCommented:
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!
0
 
rin1010Commented:

 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."

 

0
 
patedmCommented:
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?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now