information   Information
Locking your PC protects it from unauthorized use when you need to step away from the PC, and don't want to sign out or shut down.

When you lock the computer, you will be taken to the lock screen by default to unlock and sign in when ready to continue where you left off. Other users can still sign in to their accounts from the sign-in screen.

If you like, you can still create an elevated task to play a sound when users unlock the computer.

This tutorial will show you how to play a sound when users unlock the computer in Windows 7, Windows 8, Windows 10.

You must be signed in as an administrator with a password to create an elevated task.


Here's How:

1. Press the Win+R keys to open Run, type taskschd.msc into Run, and click/tap on OK to open Task Scheduler.

2. Click/tap on Task Scheduler Library in the left pane of Task Scheduler, and click/tap on Create Task in the right Actions pane. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-1.jpg

3. In the General tab, type a name (ex: "Play unlock sound") you want for this task. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-2.png

4. In the General tab, select (dot) Run whether user is logged on or not. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-3.png

5. In the General tab, check the Run with highest privileges box. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-4.png

6. In the General tab, select your OS (ex: "Windows 10") in the Configure for drop down. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-5.png

7. Click/tap on the Triggers tab, and click/tap on the New button. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-6.png

8. Select On workstation unlock in the Begin the task drop down, and click/tap on OK. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-7.png

9. Click/tap on the Actions tab, and click/tap on the New button. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-8.png

10. Perform the actions below: (see screenshot below)

A) Select Start a program in the Action drop down.

B) Type PowerShell in the Program/script field box.

C) Enter the command below into the Add arguments field box, and click/tap on OK.

-c (New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Unlock.wav').PlaySync();

Note   Note
If you wanted to play a sound (.wav file) of your choice instead, you can substitute C:\Windows\Media\Windows Unlock.wav in the command above with the full path of the .wav file you want to be played.

The Windows Unlock.wav file is not available in Windows 7, but you can download it below if you like.

Download
Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-9.png

11. Click/tap on the Conditions tab, uncheck the Start the task only if the computer is on AC power box, and click/tap on OK. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-10.png

12. Enter your account's password, and click/tap on OK. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-11.png

13. This task (ex: "Play unlock sound") is now finished, and will now play a sound when users unlock the computer. (see screenshot below)

Play Sound when Unlock Computer in Windows-play_sound_at_unlock_task-12.png


That's it,
Shawn