W
W
West122019-02-14 09:58:39
laptops
West12, 2019-02-14 09:58:39

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

2 answer(s)
R
radio13, 2019-02-14
@radiist13

remove battery from laptop

D
datka, 2019-02-14
@datka

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

instead of tooltip("AC UNPLUGGED =|)----x") you need Shutdown ( 5 ) (more here https://www.autoitscript.com/autoit3/docs/function... )
With a slight movement of your hand, do EXE- shnik you throw it on autoload and get a cycle.
Sleep(20) - this is the time in milliseconds. you can set it to 5 minutes.
if you don’t need it systemically, then as suggested “pull the battery out of the laptop”

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question