in reply to Re: Checking Laptop battery info
in thread Checking Laptop battery info
For win you could do something like this:
#!/usr/bin/perl -l use Win32::OLE('in'); my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\.\\root\\cimv2 +") or die "WMI connection failed.\n"; $colItems = $objWMIService->ExecQuery("Select * from Win32_Battery","W +QL",0x30); print "$_->{DeviceID} ($_->{Description}): $_->{EstimatedChargeRemaini +ng}%" for in $colItems;
Of course, I get percentages greater than 100% when I'm plugged in so it isn't completely ideal. =/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Checking Laptop battery info
by stonecolddevin (Parson) on Jul 10, 2006 at 20:59 UTC | |
by Anonymous Monk on Dec 07, 2007 at 16:08 UTC |
In Section
Cool Uses for Perl