Answer the question
In order to leave comments, you need to log in
How to turn off the laptop with the lid closed when the charger (power) is disconnected?
There is a laptop that works as a small server. Works with closed lid. How to make it turn off (not into sleep and not into hibernation) after the power is lost (charging disconnected / electricity turned off).
In the Win7/10 power plans there is such an item as "Close the lid actions" and there you can select the action - Shut down. But this must be done by manipulation: open-close the lid, then it will turn off. If power is lost when the lid is closed, no action will occur.
Actually how to fix this primus?
Answer the question
In order to leave comments, you need to log in
If you want the system to turn itself off after a power failure, then here's the solution. Download AutoIT. Here's a script that every 20 milliseconds checks whether the adapter is connected or not.
;WaitForBattery
;John Puskar 01/16/2013
;[email protected]
;windowsmasher.wordpress.com
Local $objwmiservice2 = ObjGet ('winmgmts:\\localhost\root\wmi')
$i = 0
While 1
Sleep(20)
local $oBattery = $objWMIService2.ExecQuery("SELECT * FROM BatteryStatus WHERE Voltage > 0")
If IsObj($oBattery) Then
SetError(0)
Dim $errorCode
Dim $batteryInfo
Dim $acPower
For $batteryInfo in $oBattery
$acPower = $batteryInfo.PowerOnline
Next
$errorCode = @Error
If $errorCode <> 0 Then
ExitLoop
ElseIf $acPower <> True Then
If $i = 0 Then
tooltip("AC UNPLUGGED =|)----x")
EndIf
Else
tooltip("AC Plugged In u====D----O:")
EndIf
Else
ExitLoop
EndIf
Wend
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question