You are currently offline, waiting for your internet to reconnect

How to Set the NUM LOCK State at Logon Using a Logon Script

This article was previously published under Q262625
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy.
Windows preserves the keyboard state when a user logs off. When a user logs off and then logs on again, the NUM LOCK state is set to "off."

There may be times when you want to set the NUM LOCK state to "on" when a user logs on. You can accomplish this using a script file that you can distribute at startup or through Group Policy. NOTE: This article relies on the use of Microsoft Windows Script Host. Windows 2000 and Windows 98 clients properly run .vbs scripts. To run .vbs scripts on Microsoft Windows NT 4.0 and Microsoft Windows 95 clients, you can install Windows Script Host on those clients.

If Windows Script Host is already installed, Microsoft strongly recommends that you download the latest version of this tool to ensure that it works properly. You can find the latest information about Windows scripting at the following Microsoft Web site: For additional information, visit the following Microsoft Group Policy White Paper Web site:
To configure a script to change the NUM LOCK state, use the following steps:
  1. Start Notepad.
  2. Copy and paste the following data into the text file:
    set WshShell = CreateObject("WScript.Shell")WshShell.SendKeys "{NUMLOCK}"					
  3. Save the file as Numlock.vbs. This properly creates the file with the .vbs extension.

    NOTE: The icon changes from a Notepad icon to a script icon. If the icon doesn't change, the file was probably saved as a text file. To change the icon, rename the file using the .vbs extension.
After you create the script, you can run the script at startup or by using Group Policy.

Running the Script at Startup

To configure the script to run locally using the Startup folder, copy the Numlock.vbs file to the user's startup folder that is normally found in the user's profile path. To configure the script to run for all users, put the script in the Startup folder in the All Users profile.

The following example shows the default path for this folder:
Documents and Settings\All Users\Start Menu\Programs\Startup

Running the Script Using Group Policy

To configure the newly created script to run using Group Policy, you must first copy the Numlock.vbs script file into the Group Policy logon script folder.

The following example shows the default path for a local logon script:
The following example shows the path for a domain logon script:
After you copy the script to the appropriate location, use the following steps:
  1. Start Microsoft Management Console (MMC) by clicking Start, clicking Run, and then typing mmc.
  2. On the Console menu, click Add/Remove Snap-in.
  3. Click Add, click Group Policy, and then click Add.
  4. Click the appropriate Group Policy Object (the default selection is the local computer).

    NOTE: Click Browse to select a different Group Policy Object.
  5. Click Finish, click Close, and then click OK.
  6. In the Group Policy Management snap-in, locate the following folder:
    User Configuration\Windows Settings\Scripts (Logon/Logoff)
    NOTE: You can substitute the Computer Configuration folder for the User Configuration folder.
  7. Double-click the Logon script object. Click Add, click Browse, and then click the Numlock.vbs script.
  8. After you select the script, click Open, and then click OK.
  9. Click OK, and then close the Group Policy Management console.
numlock wsh gpo

Article ID: 262625 - Last Review: 08/08/2007 06:49:06 - Revision: 6.5

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 98 Standard Edition
  • kbenv kbhowto KB262625