Choose when the rule applies

For an explicit step-away routine, set the normal rule and manually enable it. For a PC that should respond whenever Windows is locked, use the separate locked profile instead. These choices are independent, so normal monitoring can remain off while locked-session responses still work.

  1. Under Triggers, set USB device connected to Shut down. Review every other action; use Do nothing for events outside this scenario.
  2. If the rule should also apply while locked, turn on Windows locked → Monitor while Windows is locked and set its USB device connected row to Shut down.
  3. Set locked rows you do not want to react to to Do nothing. Those choices take priority over normal rules while locked.
  4. Leave General → Force apps to close off for the first trials, and click Save.

Test with a nonessential peripheral

Use Test monitoring (no actions) before enabling real responses. Connect a harmless device and open Event history after stopping the dry run. Confirm the arrival event and simulated shutdown. To test only the locked profile, start the whole application with Test monitoring.cmd while no other copy is running, then lock Windows normally.

Expected result and practical limits

In an activated release, a matching event requests shutdown immediately. Without force-close, Windows or an application may delay or prevent completion; an accepted request is not proof that the PC powered off. Save work before trying real shutdown.

Your own keyboard, hub, dock or reconnecting peripheral can trigger the same rule. USB communication can begin before notification reaches DeskLatch, so this is not a USB access blocker or malware inspection tool. If your goal is to reject unknown devices but allow specific ones, this app does not provide that policy. See the separate removal response and locked-only setup.