You are currently offline, waiting for your internet to reconnect

Programs to Turn NUM LOCK On and Off

This article was previously published under Q71632
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.
During the power on self test (POST), the ROM BIOS on some computerswill activate the keyboard's NUM LOCK key. As a result, each time youreboot the system, the NUM LOCK key must be manually turned off beforeyou can access the editing keys (the arrow keys, and so forth) on thenumeric keypad. This behavior is a function of the computer'shardware, rather than of MS-DOS.
In MS-DOS version 6.x adding
to the CONFIG.SYS file will turn off the NUM LOCK key.

The program described below (NUM_OFF.COM) can be called from yourAUTOEXEC.BAT to turn off the NUM LOCK key automatically each time thesystem is booted.

You can use the MS-DOS DEBUG command to create a program (NUM_OFF.COM)that will turn the NUM LOCK key off. To create NUM_OFF.COM, do thefollowing:

  1. Create a DEBUG script file (NUM_OFF.SCR) using a text editor such as the MS-DOS Edlin line editor (see the "MS-DOS User's Guide" for more information on Edlin.) The NUM_OFF.SCR file should 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>      and byte ptr [0017],df<ENTER>      mov ax,4c00<ENTER>      int 21<ENTER>      <ENTER>      r cx<ENTER>      000f<ENTER>      n<ENTER>      w<ENTER>      q<ENTER>						
  2. Redirect this script file into the DEBUG utility by entering the following command at the DOS prompt:
    C:\>debug < num_off.scr
  3. The NUM_OFF.COM program has now been created. To test the program, turn the NUM LOCK key on, then call the NUM_OFF.COM program by entering the following command:
    This procedure should result in the NUM LOCK indicator light going out just as if you had pressed the NUM LOCK key.
This program can be modified to turn the NUM LOCK on rather than off.To do this, follow the steps in the example above, replacing allinstances of "NUM_OFF" with "NUM_ON" and substituting the followingline for the fourth line of the DEBUG script file:
   or byte ptr [0017],20<ENTER>				
3.20 3.21 3.30 3.30a 4.00 4.01 4.01a 5.00 win95

Article ID: 71632 - Last Review: 05/12/2003 21:15:36 - 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
  • KB71632