Because LC can't do two things at once.

Bob Sneidar bobsneidar at iotecdigital.com
Mon Feb 23 13:38:49 EST 2015


It appears that when the battery is fully recharged, the Availability is still 2, but the BatteryRechargeTime becomes empty instead of a number. Will that do it for you?

Bob S


On Feb 23, 2015, at 09:08 , Bob Sneidar <bobsneidar at iotecdigital.com<mailto:bobsneidar at iotecdigital.com>> wrote:

Okay I think I have found a way to get the battery status. I checked it on my VM of Windows 7. Your results may vary.

Try shell("WMIC Path Win32_Battery Get Availability”)

Line 3 will contain 2 if the battery is charging, 3 if running on battery, and I am going to say 1 if the battery is fully charged. I’ll have to check that later as my battery is currently charging at the moment.

Now for the teaching moment: WMIC can give you just about any information you want about the hardware you are running on. Spiceworks Inventory and Helpdesk system makes extensive use of WMIC when querying Windows devices.

HTH
Bob S



More information about the Use-livecode mailing list