Programs to Turn CAPS LOCK Key Off or On

This article was previously published under Q71511
This article has been archived. It is offered "as is" and will no longer be updated.
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 turnCAPS LOCK off; see the instructions following the steps for creation ofCAPS_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 dothis, follow the steps in the example above, replacing all instances of"CAPS_ON" with "CAPS_OFF" and substituting the following line for thefourth line of the DEBUG script file:
and byte ptr [0017],bf<ENTER>
6.22 3.20 3.21 3.30 3.30a 4.00 4.01 5.00 5.00a 6.00 6.20

Article ID: 71511 - Last Review: 12/04/2015 09:07:27 - 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

  • kbnosurvey kbarchive KB71511