I have a package which decrypts hard disk and then encrypts. This will be taking a lot of time. So, we do not want it to be installed when the laptop is on battery. How do i check whether the machine is on battery or cable.

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

2

It kind of depends how you are deploying your package, but there are at least a couple of ways to do it (assuming Windows):

http://blogs.technet.com/b/heyscriptingguy/archive/2007/04/09/how-can-i-tell-whether-a-laptop-computer-is-running-off-batteries.aspx

http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/31/using-windows-powershell-to-determine-if-a-laptop-is-on-battery-power.aspx

 

Answered 05/08/2013 by: jknox
Red Belt

Please log in to comment
2

Check this link: http://lmgtfy.com/?q=wmi+query+on+mains+or+battery&l=1

You will need to use WMI...

Answered 05/08/2013 by: rileyz
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity