From: BNSGuy on
Problem: Initial Numlock status annoyance. Would like to ensure that
numlock is ON for systems that have a dedicated numeric keypad section
(such as desktops and laptops with external keyboards) but OFF for
laptops that only have the alphabetic section..

I know how to change the numlock status. no problem. The issue is
discriminating between those hosts for which it is appropriate, and
those for which it is not. I'm not looking for language settings,
just whether or not there is a dedicated number pad. Any thoughts?
From: Corey on
I get an instance of the Win32_Battery object. If it enumerates then
there is a battery and most likely it's a laptop.



On Apr 29, 3:57 am, BNSGuy <daniel.a.mur...(a)gmail.com> wrote:
> Problem: Initial Numlock status annoyance.  Would like to ensure that
> numlock is ON for systems that have a dedicated numeric keypad section
> (such as desktops and laptops with external keyboards) but OFF for
> laptops that only have the alphabetic section..
>
> I know how to change the numlock status.  no problem.  The issue is
> discriminating between those hosts for which it is appropriate, and
> those for which it is not.  I'm not looking for language settings,
> just whether or not there is a dedicated number pad.  Any thoughts?

From: BNSGuy on
On Apr 29, 7:46 am, Corey <cotho...(a)comcast.net> wrote:
> I get an instance of the Win32_Battery object.   If it enumerates then
> there is a battery and most likely it's a laptop.
>
> On Apr 29, 3:57 am, BNSGuy <daniel.a.mur...(a)gmail.com> wrote:
>
>
>
> > Problem: Initial Numlock status annoyance.  Would like to ensure that
> > numlock is ON for systems that have a dedicated numeric keypad section
> > (such as desktops and laptops with external keyboards) but OFF for
> > laptops that only have the alphabetic section..
>
> > I know how to change the numlock status.  no problem.  The issue is
> > discriminating between those hosts for which it is appropriate, and
> > those for which it is not.  I'm not looking for language settings,
> > just whether or not there is a dedicated number pad.  Any thoughts?- Hide quoted text -
>
> - Show quoted text -

Good idea. Should take care of most instances, although we do have
more than a couple users with workstation-type laptops that also have
a dedicated number keypad. I guess we'll have to pick them off onesy-
twosy.
From: Ruediger Roesler on
BNSGuy <daniel.a.murray(a)gmail.com> typed:

> Good idea. Should take care of most instances, although we do have
> more than a couple users with workstation-type laptops that also have
> a dedicated number keypad. I guess we'll have to pick them off onesy-
> twosy.

If you want to detect an active driver, e.g. something like USB driver,
then you can take such a function like this:

Function IsDeviceStarted(strUSBDev)
Const USBCTRL = "Win32_USBControllerDevice"
Dim wmiUSBDev, wmiPNPDev

For Each wmiUSBDev In wmi.ExecQuery("select * from " & USBCTRL)
Set wmiPNPDev = wmi.Get(wmiUSBDev.Dependent)
If InStr(1, wmiPNPDev.Name, strUSBDev, vbTextCompare) > 0 Then
IsDeviceStarted = True
Exit Function
End If
Next
End Function

You can call this function with a name of an USB device:
If IsDeviceStarted("HID-Keyboard") Then ...

The Win32_SystemDriverPNPEntity association class relates a PnP device
on the computer system and the driver that supports the PnP device. The
Antecedent property is referenced to the Win32_PnPEntity instance
representing the PnP device controlled by the driver. The Dependent
property is referenced to the Win32_SystemDriver instance representing
the driver that supports the PnP device.

'########################## ListDevices.vbs ###########################
' von h.r.roesler
Dim wmiDev, wmiSysDrvr, wmiPNPDrvr

Set wmi = GetObject("WinMgmts:{impersonationLevel=impersonate}!" & _
"root/CIMV2")

For Each wmiDev In wmi.ExecQuery("select * from " & _
"Win32_SystemDriverPNPEntity")
WScript.Echo wmiDev.Antecedent
Set wmiPNPDrvr = wmi.Get(wmiDev.Antecedent)
WScript.Echo wmiPNPDrvr.Name
WScript.Echo wmiDev.Dependent
Set wmiSysDrvr = wmi.Get(wmiDev.Dependent)
WScript.Echo wmiSysDrvr.Name & vbCRLF
Next
'########################## ListDevices.vbs ###########################

--
ЯR

From: MikeB on
On Apr 29, 2:57 am, BNSGuy <daniel.a.mur...(a)gmail.com> wrote:
> Problem: Initial Numlock status annoyance.  Would like to ensure that
> numlock is ON for systems that have a dedicated numeric keypad section
> (such as desktops and laptops with external keyboards) but OFF for
> laptops that only have the alphabetic section..
>
> I know how to change the numlock status.  no problem.  The issue is
> discriminating between those hosts for which it is appropriate, and
> those for which it is not.  I'm not looking for language settings,
> just whether or not there is a dedicated number pad.  Any thoughts?

OK, I know probably less than nothing in this area, but I came across
this article by accident and maybe there is something in there that
can be of help to you?

http://msdn.microsoft.com/en-us/library/ms646298

I don't even know what environment it relates to, but heck, it's only
5 seconds of your time to check it out.