I am using this code, and have logonscrictsync set on.

The variable $Laptop is read from an ini-file, because it is not practical to have NumLock on on Laptops we turn it
of on Laptops, and on on Desktops.

Code:
If $Laptop = 'Y' ; Slå NumLock fra på bærbare
If ReadValue("HKCU\Control Panel\Keyboard","InitialKeyboardIndicators") <> "0"
$RC = WriteValue("HKCU\Control Panel\Keyboard","InitialKeyboardIndicators","0","REG_SZ")
$RC = SendKeys("{NUMLOCK}")
EndIf
Else ; Slå NumLock til på Desktop PC'er
If ReadValue("HKCU\Control Panel\Keyboard","InitialKeyboardIndicators") <> "2"
$RC = WriteValue("HKCU\Control Panel\Keyboard","InitialKeyboardIndicators","2","REG_SZ")
$RC = SendKeys("{NUMLOCK}")
EndIf
EndIf


-Erik