Programs to Turn CAPS LOCK Key Off or On

Article translations Article translations
Article ID: 71511 - View products that this article applies to.
This article was previously published under Q71511
Expand all | Collapse all


You can use the MS-DOS DEBUG utility to create a program (CAPS_ON.COM) that turns on the CAPS LOCK key. (Note: You can modify CAPS_ON.COM to turn CAPS LOCK off; see the instructions following the steps for creation of CAPS_ON.COM.)


Follow the steps below to create CAPS_ON.COM:
  1. Create a DEBUG script file (CAPS_ON.SCR) using a text editor such as the MS-DOS EDLIN line editor. (See the "Microsoft MS-DOS User's Guide" for more information on EDLIN.) The CAPS_ON.SCR file must contain the following lines exactly (where <ENTER> means to press the ENTER key on the keyboard):
    a 100<ENTER>
    mov ax,0040<ENTER>
    mov ds,ax<ENTER>
    or byte ptr [0017],40<ENTER>
    mov ax,4c00<ENTER>
    int 21<ENTER>
    r cx<ENTER>
  2. Redirect this script file into the DEBUG utility by entering the following command at the DOS prompt:
    C:\>debug < caps_on.scr
  3. The CAPS_ON.COM program has now been created. To test the program, turn off the CAPS LOCK key, then call the CAPS_ON.COM program by entering the following command:
    This should result in the CAPS LOCK indicator light coming on just as if you had pressed the CAPS LOCK key.
This program can be modified to turn CAPS LOCK off rather than on. To do this, follow the steps in the example above, replacing all instances of "CAPS_ON" with "CAPS_OFF" and substituting the following line for the fourth line of the DEBUG script file:
and byte ptr [0017],bf<ENTER>


Article ID: 71511 - Last Review: May 12, 2003 - Revision: 2.0
  • Microsoft MS-DOS 3.1
  • Microsoft MS-DOS 3.2 Standard Edition
  • Microsoft MS-DOS 3.21 Standard Edition
  • Microsoft MS-DOS 3.3 Standard Edition
  • Microsoft MS-DOS 3.3a
  • Microsoft MS-DOS 4.0 Standard Edition
  • Microsoft MS-DOS 4.01 Standard Edition
  • Microsoft MS-DOS 5.0 Standard Edition
  • Microsoft MS-DOS 5.0a
  • Microsoft MS-DOS 6.0 Standard Edition
  • Microsoft MS-DOS 6.2 Standard Edition
  • Microsoft MS-DOS 6.21 Standard Edition
  • Microsoft MS-DOS 6.22 Standard Edition
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from