http://dieseyer.de • all rights reserved • © 2011 v11.4
'v4.B***************************************************
' File: numlock-ein.vbs
' Autor: dieseyer@gmx.de
' dieseyer.de
'
' Das schaltet NumLock für den Anmeldedialog ein.
' Vergl. http://support.microsoft.com/?id=154529
'*******************************************************
Option Explicit
Dim WSHNet : Set WSHNet = WScript.CreateObject("WScript.Network")
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Dim Txt, PCName, KeyPath, KeyKey, KeyInh, oReg
PCName = "."
PCName = WshNet.ComputerName
KeyPath = ".DEFAULT\Control Panel\Keyboard"
KeyKey = "InitialKeyboardIndicators"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & PCName & "\root\default:StdRegProv")
oReg.GetExpandedStringValue HKEY_USERS,KeyPath,KeyKey,KeyInh
Txt = KeyInh
KeyInh = "2"
oReg.CreateKey HKEY_USERS,KeyPath
oReg.SetStringValue HKEY_USERS,KeyPath,KeyKey,KeyInh
oReg.GetExpandedStringValue HKEY_USERS,KeyPath,KeyKey,KeyInh
MsgBox "vorher:" & vbTab & Txt & vbCRLF & "nacher:" & vbTab & KeyInh, , PCName
WScript.Quit
http://dieseyer.de • all rights reserved • © 2011 v11.4