Turning Num lock on without a keyboard

Turning Num lock on without a keyboard

Author
Discussion

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
Here is a little tough one.
In the branches the counters have POS terminals which are Win 2k machines with Alphapos keyboards. Like a standard keyboard but with more buttons. Unfortunatley the keyboard does not have a num lock key. When set up the machines had a normal keyboard which was used to set the profile to have num lock on. They are now built into the counter so not easy to get at.

One of the machines has had the Numlock toggled off. It it set in Bios to be on but when you log on it goes off due to the windows profile.

What I need is a soft key to turn it on. Have tried using VNC but that just toggled my local keyboard.

Any ideas? It will save me a 320 mile round trip.

Rich-UK

1,431 posts

263 months

Friday 15th August 2003
quotequote all
There is a registry key that sets the Num Lock status in each users profile (sorry, can't remember it, but it'll be MS' website). You could add it to a logon scrpt.

I haven't got VNC inalled at the moment, but doesn't it have the option to do Ctrl-Alt-Del etc from the window menu (the one with move, size etc.), There might be a Num Lock option there

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
unfortunatley VNC doesn't

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
VbScript in the startup to interrogate the registry and check whether its on or not, something like this?

Dim WSHShell, NumKeyHU, NumKeyCU, NumValue, itemtype, NumOn

Set WSHShell = WScript.CreateObject("WScript.Shell")
NumKeyHU = "HKEY_USERS.DefaultControl
PanelKeyboardInitialKeyboardIndicators"
NumKeyCU = "HKCUControl PanelKeyboardInitialKeyboardIndicators"
itemtype = "REG_DWORD"
NumValue = "2"

NumOn = WshShell.RegRead("HKCUControl
PanelKeyboardInitialKeyboardIndicators")

If NumOn "2" then
WSHShell.RegWrite NumKeyHU, NumValue
WSHShell.RegWrite NumKeyCU, NumValue
NumOn = WshShell.RegRead(NumKeyCU)
ElseIf NumOn = "2" then
Msgbox "Numlock is already on"
Wscrpt.Quit
End If

If NumOn = "2" then
Msgbox "The users numlock will turn on at bootup"
Else
Msgbox "The users numlock is not on"
End if

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
Cool.

Being a bit thick today, but how do I run this?

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
Copy it into notepad and save it as numlock.vbs or similar.

Then copy this numlock.vbs file into the start up group of the PC

It will then execute on boot, after policies etc have turned it off.

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
I presume that it should be

If NumOn < > "2" then
without the space

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
Yep!

Its a web plaigarism...

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
Cool except I am getting
Error: Invalid root in registry key ""HKCUControl PanelKeyboardInitialKeyboardIndicators"

Is this for win2000?

pdV6

16,442 posts

268 months

Friday 15th August 2003
quotequote all
Liszt said:
Cool except I am getting
Error: Invalid root in registry key ""HKCUControl PanelKeyboardInitialKeyboardIndicators"

Is this for win2000?

:guess mode:
Shouldn't "HKCUControl PanelKeyboardInitialKeyboardIndicators" read "HEY_CURRENT_USER.Control PanelKeyboardInitialKeyboardIndicators" ?
:/guess mode:

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
nope produces same message but with HEY_CURRENT_USER.Control PanelKeyboardInitialKeyboardIndicators as the offending item.

But thanks anyway

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
Perhaps with the slashes so:

HKEY_CURRENT_USERControl PanelKeyboardInitialKeyboardIndicators

?

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
slashes?

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
Ahh its Teds interpreter thing.

Where there are [ in the following replace them with backslashes

HKEY_CURRENT USER[ControlPanel[Keyboard[InitialKeyboardIndicators

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
nope still not working with slashes of any sort!

Any more ideas?

plotloss

67,280 posts

277 months

Friday 15th August 2003
quotequote all
You'll have to do that for all the registry strings...

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
so NumKeyHU = "HKEY_USERS[DefaultControl Panel[Keyboard[InitialKeyboardIndicators"
NumKeyCU = "HKCU[Control Panel[Keyboard[InitialKeyboardIndicators"


NumOn = WshShell.RegRead("HKEY_CURRENT USER[Control Panel[Keyboard[InitialKeyboardIndicators"

where [ = ?

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
hangf on a mo just noticed a missing underscore

Liszt

Original Poster:

4,330 posts

277 months

Friday 15th August 2003
quotequote all
Right that appears to work on my machine. Now to test it.

Thanks chaps. I new there wasn't anything which couldn't be solved by posting on pistonheads