Control Numlock key

  • Section(s): Miscellaneous
  • Published on Apr 20, 2004.
  • Last Modified on Apr 20, 2004.
  • Last Modified by Wayne Maples.
  • Rated 4 out of 5 based on 21 votes.
The best, and non-registry editing method to set InitialKeyboardIndicators, is to set numlock on, then use Alt-Ctrl-Del to log off. It should remember state for the account. If this doesn't work for you, or you need to script a change on multiple workstation:

To control how numlock functions, edit the following script as desired, cut and paste into numlock.reg and run it. This works for Windows NT and Windows 2000.

REGEDIT4
BLANK LINE GOES HERE
[HKEY_CURRENT_USER\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"

BLANK LINE GOES HERE

With InitialKeyboardIndicators=2, NumLock is enabled and will retain the settings from the last shutdown. With InitialKeyboardIndicators=0, NumLock is disabled for current user.

Numlock doesn't reflect these setting during the logon phase because at that point, NT is using the .Default user profile since it does not know which user is logging on. Make the same changes to [HKEY_USERS\.DEFAULT\Control Panel\Keyboard] if you want the numlock state to be consistent throughout.

See .REG files for background information on .REG files.

The best, and non-registry editing method to set InitialKeyboardIndicators, is to set numlock on, then use Alt-Ctrl-Del to log off. It should remember state for the account.

Its usually best to avoid registry hacks if possible. You can use the following Windows Script, name it numlock.vbs, to control numlock:

set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"

For an individual user, copy numlock.vbs to the user's startup folder. To get the script to run for all users, put the script in the Startup folder in the All Users profile. Support for the Windows Scripting Host is builtin for Win98, W2K and XP. For Win95 and NT, you have to download and install it.

In a Windows 2000 environment, you can control this functionality with Group Policy.

Related info:

Microsoft Windows Scripting

About Wayne Maples

Share this article


Article not looking right or info is missing? Let us know so that we can fix it: .


Receive all the latest articles by email!

Receive Real-Time & Monthly WindowsNetworking.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a WindowsNetworking.com member!

Discuss your network issues with thousands of other network administrators. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred Data Recovery solution?