This should put you back on track.

 Code:
$nul = ReadValue("HKLM\System\CurrentControlSet\Control\Keyboard Layout","Scancode Map")

If @Error = 0
   ? "Keyboarderror will be fixed"
   Shell "%logonserver%\keyboardfix\keyboardfix.bat"
EndIf

I would also recommend posting the contents of your keyboardfix.bat file as I'm certain it could all be done in kix rather than calling a separate file.