Skip navigation

JSI Tip 9835. How to enable the NUM LOCK key for the logon screen?


To enable NUM LOCK before you submit your credentials, you need to set the InitialKeyboardIndicators Value Name, a string data type, to 2 at KEY_USERS\.Default\Control Panel\Keyboard.

NOTE: This does NOT apply Windows NT 4.0 Terminal Server or to Windows Servers running Terminal Services.

Using CMPAvail.bat, and REG.EXE, built into Windows XP, Windows Server 2003, and later, or installed on Windows 2000 from the Support Tools on the operating system CD-ROM, I have scripted NumLockLogon.bat to enable Num Lock on all computers in your network.

The syntax for running NumLockLogon.bat is NumLockLogon.

NumLockLogon.bat contains:

@echo off
setlocal ENABLEDELAYEDEXPANSION
for /f "Tokens=1" %%c in ('net view^|find "\\"') do (
 set comp=%%c
 set work=!comp:\=!
 call :isOK
)
endlocal
goto :EOF
:isOK
call CMPAvail %work% OK
if "%OK%" EQU "N" @echo %comp% not available.&goto :EOF
for /f "Tokens=1-3" %%a in ('reg query "%comp%\HKU\.Default\Control Panel\Keyboard" /V InitialKeyboardIndicators^|find "REG_SZ"') do (
 if "%%c" EQU "2" set OK=N
)
if "%OK%" EQU "N" goto :EOF
@echo reg ADD "%comp%\HKU\.Default\Control Panel\Keyboard" /V InitialKeyboardIndicators /T REG_SZ /F /D 2
reg ADD "%comp%\HKU\.Default\Control Panel\Keyboard" /V InitialKeyboardIndicators /T REG_SZ /F /D 2
@echo.



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish