Sign in to follow this  
Followers 0
SIMPLE_XP

Detect if laptop is running on Battery or not...

4 posts in this topic

Can anyone point me in the right direction in determining if a laptop is running on a battey or not? Thanks in advance.


Hero's Dawn, an RPG Adventure completely coded in AutoITwmifunctions UDF, WMI UDF

Share this post


Link to post
Share on other sites



Can anyone point me in the right direction in determining if a laptop is running on a battey or not? Thanks in advance.

I recently needed to perform this action for an installation package I was tasked to build. I used the value of the following registry key to determine whether it was on AC or DC power. It worked for all of my instances, but may not work for yours.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Systray" "Services"

I believe this key determines if the battery indicator should appear in the System Tray. I found the DWORD value of '30' proved to be on AC power, and '31' proved to be on battery power.

Good luck!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0