VBScript - 自動開啟 Num Lock

功能說明

此 VBScript 程式功能為將 Num Lock 開啟,不管是登入前 (Ctrl + Alt + Del 後輸入帳密時) 或是登入後 (成功驗證) 都開啟 Num Lock



實作環境

  • Windows Server 2000 (測試成功)
  • Windows XP Professional (測試成功)

NumLockAlwaysOn.vbs 內容及說明

  • Path1 機碼路徑為開啟登入 (Ctrl + Alt + Del 後輸入帳密時) Num Lock 功能
  • Path2 機碼路徑為開啟登入 (成功驗證後) Num Lock 功能
  • InitialKeyboardIndicators 數值為 0:Num Lock is OFF (Default)
  • InitialKeyboardIndicators 數值為 2:Num Lock is ON
Dim Path
Path1="HKEY_USERS\.DEFAULT\Control Panel\Keyboard\"   //登入前 (Ctrl + Alt + Del 後輸入帳密時)
Path2="HKEY_CURRENT_USER\Control Panel\Keyboard\"    //登入後 (成功驗證後)
Set ws=WScript.CreateObject("WScript.Shell")
ws.RegWrite Path1&"InitialKeyboardIndicators",2,"REG_SZ"    //Num Lock is ON (Login Before)
ws.RegWrite Path2&"InitialKeyboardIndicators",2,"REG_SZ"    //Num Lock is ON (Login After)


參考