KeyRoutines
AudioWorks on Free

How to mute sound and pause music when you lock your PC

Create a KeyRoutines routine with the PC locked and PC unlocked triggers. Started by trigger picks the branch: on lock, Media control pauses and Mute or unmute silences the master output; on unlock, the sound comes back.

Steps

  1. 1

    Add both triggers

    Add the PC locked trigger and the PC unlocked trigger to the same routine.

  2. 2

    Branch on what happened

    Add an If with Started by trigger set to PC locked.

  3. 3

    Go quiet on lock

    In the If branch, add Media control set to Pause, then Mute or unmute on the master output set to mute.

  4. 4

    Come back on unlock

    In the Else branch, add Mute or unmute set to unmute. Add Media control set to Play if you want the music to continue.

Tips

  • Resuming on unlock will also start music that wasn't playing before. Use Remember on lock and Remembered value is on unlock if you only want to resume what you paused.

Questions

Does it work with Win+L?
Yes. The PC locked trigger fires however the PC locks: Win+L, the Start menu, or Windows locking it after a timeout.
Can it lock the PC for me too?
Yes. KeyRoutines has a Lock the PC step you can put at the end of a hotkey routine.

Blocks this routine uses

More how-to guides

Build this routine in KeyRoutines

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