Choose an appropriate response
For a laptop left closed on a dock, you might request restart if its lid opens while Windows is locked. If the charger being removed should matter too, add a separate power-unplugged rule. Leave these off during ordinary mobile use if those transitions are part of your routine.
- Open Windows locked and enable Monitor while Windows is locked.
- Set Lid opened to your chosen Restart or Shut down response.
- Independently set Power unplugged, or leave it at Do nothing.
- Review Resume from sleep. Opening the lid may also wake the laptop, so that row should reflect your intended behavior.
- Save the profile. Use the matching Triggers rows only if you also want these events during normal armed monitoring.
Test the actual transitions
Run the entire app through Test monitoring.cmd, with no regular instance still running. On a sufficiently charged laptop, test unplugging and reconnecting its charger. Separately close and reopen the lid under your normal Windows power configuration. For locked rules, lock Windows first and inspect Event history after signing in.
DeskLatch establishes the initial state as a baseline. Merely starting the app on battery, or with the lid already open, is not the transition this rule watches. A lid-opening rule requires a reported closed-to-open change.
Limits to account for
Power unplugged means a transition from AC to the laptop's onboard battery; a UPS does not qualify. Unsupported hardware or drivers may provide no useful lid or power notification. DeskLatch does not change what Windows does when the lid closes and cannot monitor while the machine itself is asleep.
Use the recorded results to decide whether the setup is reliable for your laptop. See testing and history and the separate dock/display scenario.