Mute System Volume On Windows Lock with Task Scheduler

Print View Mobile View

It’s a good habit to lock Windows when you are going away from your PC to keep prying eyes away. However, if you’re listening to music or if you are signed into a chat client, locking your computer doesn’t mute the system volume, you’ve to do it manually, unless of course you don’t mind anyone hearing.

If you’d like an automatic muting/unmuting solution, then you can use the built-in Task Scheduler and NirCmd, a command-line utility, to do the work for you.

Steps

Grab NirCmd from the developer’s website and extract the ZIP file to a folder on your computer. Then open Task Scheduler by entering taskschd.msc in the Run dialog.

A single Task is all that is required for our automated process to function. So let’s start:

  1. Create a new Task by providing it any name you want, say “Mute-Unmute Speakers”.
  2. In Triggers tab, create two triggers: “On workstation lock” and “On workstation unlock”. One is executed when you lock Windows, and the other when you unlock it.
  3. In Action tab, select “Start a program” for Action. Then browse to the folder where you had extracted the NirCmd ZIP file, and select nircmd.exe executable file. In arguments, enter mutesysvolume 2.

Mute Volume
You can customize the task further in other tabs, but basically this is all you got to do. Hit OK to save.

Now, play some music and test if the task executes as intended.

If for some reason a single task script doesn’t work for you, try creating separate tasks for lock and unlock triggers. Steps are the same, except for the arguments in Actions tab. Enter following accordingly:

  • Mute the system volume: mutesysvolume 1
  • Unmute the system volume: mutesysvolume 0

This tip should work on 32-bit and 64-bit versions of all Windows versions.

If you prefer a software solution, there’s the freeware Mute on Lock, though note that you might have to use the Windows Compatibility Mode feature set to Windows XP to get it to work properly on newer Windows versions.