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

Article translations Article translations
Article ID: 262625 - View products that this article applies to.
This article was previously published under Q262625
Notice
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.
Expand all | Collapse all

On This Page

SUMMARY

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:
http://msdn2.microsoft.com/en-us/library/ms950396.aspx
For additional information, visit the following Microsoft Group Policy White Paper Web site:
http://technet2.microsoft.com/windowsserver/en/technologies/featured/gp/default.mspx

MORE INFORMATION

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:
%SystemRoot%\System32\GroupPolicy\[User|Machine]\Scripts\Logon
The following example shows the path for a domain logon script:
%SysVolFolder%\Sysvol\Sysvol\Domainname\Scripts
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.

Properties

Article ID: 262625 - Last Review: August 8, 2007 - Revision: 6.5
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 98 Standard Edition
Keywords: 
kbenv kbhowto KB262625

Give Feedback

 

Contact us for more help

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