Using ANSI.SYS to Disable CTRL+C Key Combination (74578)



The information in this article applies to:
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

This article was previously published under Q74578

SUMMARY

You can use the ANSI.SYS device driver to disable the CTRL+C key combination. This is done by assigning the CTRL+C key combination to NULL.

NOTE: ANSI.SYS must be loaded in the CONFIG.SYS file to enable ANSI escape sequences.

MORE INFORMATION

To disable the CTRL+C key combination, create a file using the following steps:

    Run MS-DOS Editor.
    Type the following on the same line with no spaces between:

    CTRL+P 027

    To type this line, hold down the CTRL and P keys simultaneously and then release them. Then hold down the ALT key while you press the 0, 2, and 7 keys on the numeric keypad.

    These key combinations produce the left arrow that symbolizes the start of the ANSI escape sequence.
    On the same line, leaving no spaces, type:

    [3;0;p


    Save this file as a batch file (for example, FILE.BAT).
    Exit MS-DOS Editor.
Type the following at the MS-DOS command prompt to disable CTRL+C:

type file.bat

To enable the CTRL+C key combination, replace step 3 above with the following

[3;3p

and save the file under a different name.

By adding the TYPE command and the name of the file to the AUTOEXEC.BAT file, you can disable or enable the CTRL+C key combination when the machine starts up.

Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB74578