Post by DontBotherMeWithSpamThank you for your help. But I guess there are no battery object
present in WMI for that mouse device I have. Anyways, it was fun stuff
to try out. ;)
Oh yeah, I have enjoyed those WMI and Msh tips on your site. :)
you can filter in the WMI query also.
you can just do this
MSH>get-WmiObject Win32_PointingDevice
to see if its filled in (it will list all, but don't know how many
mouses you got but I can live with that (PS you see the ID then in the
output ;-)
then you need to "escape" the \'s in the filter (the WMI "escape")
so this works (change to your ID) :
get-wmiobject win32_pointingdevice -filter "PNPDeviceID =
'ACPI\\PNP0F13\\4&5ADF620&0'"
then you can check the Availability property :
win32_pointingdevice Properties :
Availability :
The availability and status of the device. For example, the
Availability property indicates that the device is running and has full
power
(value=3), or is in a warning (4), test (5), degraded (10) or power save
state (values 13-15 and 17). Regarding the power saving states, th
ese are defined as follows: Value 13 ("Power Save - Unknown") indicates
that the device is known to be in a power save mode, but its exact
status in this mode is unknown; 14 ("Power Save - Low Power Mode")
indicates that the device is in a power save state but still functioning
, and may exhibit degraded performance; 15 ("Power Save - Standby")
describes that the device is not functioning but could be brought to fu
ll power 'quickly'; and value 17 ("Power Save - Warning") indicates that
the device is in a warning state, though also in a power save mode
PS with my Logitec Wireless Optical it was Null ;-(
gr /\/\o\/\/
PS info came from
http://mow001.blogspot.com/2005/11/wmi-help-part-2.html
PS2 if you have the status also check this method :
SetPowerState :
SetPowerState defines the desired power state for a logical device and
when a device should be put into that state. The desired power state
is specified by setting the PowerState parameter to one of the
following integer values: 1="Full Power", 2="Power Save - Low Power Mode",
3="Power Save - Standby", 4="Power Save - Other", 5="Power Cycle" or
6="Power Off". The Time parameter (for all state changes, except 5, "P
ower Cycle") indicates when the power state should be set, either as a
regular date-time value or as an interval value (where the interval
begins when the method invocation is received). When the PowerState
parameter is equal to 5, "Power Cycle", the Time parameter indicates wh
en the device should power on again. Power off is immediate.
SetPowerState should return 0 if successful, 1 if the specified
PowerState and
Time request is not supported, and some other value if any other error
occurred. In a subclass, the set of possible return codes could be
specified, using a ValueMap qualifier on the method. The strings to
which the ValueMap contents are 'translated' may also be specified in t
he subclass as a Values array qualifier.