Control Startup Numlock Status to On/Off

pradeep's Avatar author of Control Startup Numlock Status to On/Off
This is an article on Control Startup Numlock Status to On/Off in Windows.
Rated 5.00 By 1 users
If you want Numlock to stay On or Off at startup, you can do that with a registry edit.

Navigate to HKEY_CURRENT_USER\Control Panel\Keyboard\InitialKeyboardIndicators and the change the value to 0 if you want Numlock enabled at starup, and 2 to have it enabled at startup.

Alternatively, you can use the VB ShellScript below to do the work for you.

Code: VB
Option Explicit
  On Error Resume Next
 
  Dim WSHShell, n, rK, itemtype, MyBox, vbdefaultbutton
  Set WSHShell = WScript.CreateObject("WScript.Shell")
 
  rK = "HKEY_CURRENT_USER\Control Panel\Keyboard\InitialKeyboardIndicators"
  itemtype = "REG_SZ"
 
  n = WSHShell.RegRead (rK)
  errnum = Err.Number
 
  if errnum <> 0 then
      WSHShell.RegWrite rK, 2, itemtype
  End If
 
  If n = 0 Then
     WshShell.RegWrite rK, 2, itemtype
     MyBox = MsgBox("Numlock is now ENABLED", 64, "Enable Numlock")
  End If
 
  If n = 2 Then
     WshShell.Regwrite rK, 0, itemtype
     MyBox = MsgBox("Numlock is now DISABLED", 64, "Enable Numlock")
  End If
 
  Set WshShell = Nothing