KeyRoutines
TriggerFreetrigger.session.lock

Run a routine when you lock your PC on Windows 11

PC locked starts a routine when the PC is locked, whether you pressed Win+L or the lock screen came on by itself. It turns locking into your "leaving the desk" signal.

How it works

  • It has no settings and fires every time the PC locks.
  • It follows Windows' own lock notifications, so there's no polling.
  • Your routine runs while the lock screen shows, so steps that need you, like prompts, aren't a good fit here.

Routines that use it

Pause on lock

Media control pauses your music and Mute or unmute mutes the microphone.

Turn the lights off

Turn the screen off right after locking instead of waiting for the display timeout.

Save power while away

Set power plan to Power saver, and a PC unlocked routine switches it back.

Questions

Can I run something automatically when I press Win+L?
Yes. The PC locked trigger fires whenever Windows locks, including Win+L.
Do routines keep running while the PC is locked?
Yes, routines started by this trigger run behind the lock screen. Avoid steps that need your input.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.