How to Play the Lock and Unlock Sounds in Windows 11

Опубликовано: 15 Октябрь 2024
на канале: CNATT
1,055
18

We will show you how to Enable and Change the Lock and Unlock sounds in Windows 11. The lock sound is played when you lock Windows without logging out to switch to another user or leave the system.

You have the option to customize the lock and unlock sounds for each user individually.
The lock and unlock sounds differ from those played during logoff and logon.


⏰Timestamps⏰

00:00 Intro
01:07 Step 1: Create VBScript files to play the sounds
03:38 Step 2: Set the Lock sound in Windows using the Task Scheduler
06:04 Step 3: Set the Unlock sound in Windows using the Task Scheduler
08:30 Change or Disable Lock and Unlock Sounds
09:19 Configure Lock and Unlock Sounds for Multiple Users

======================
========Code==========
https://pastebin.com/hLCJWvk6
======================
Step 1:
+++++++++++++++++++
VBScript Code For Lock Sound:
+++++++++++++++++++

Set oVoice = CreateObject("SAPI.SpVoice")
set oSpFileStream = CreateObject("SAPI.SpFileStream")
oSpFileStream.Open "C:\Media\LockSound.wav"
oVoice.SpeakStream oSpFileStream
oSpFileStream.Close

++++++++++++++++++++
VBScript Code For Unlock Sound:
++++++++++++++++++++

Set oVoice = CreateObject("SAPI.SpVoice")
set oSpFileStream = CreateObject("SAPI.SpFileStream")
oSpFileStream.Open "C:\Media\UnlockSound.wav"
oVoice.SpeakStream oSpFileStream
oSpFileStream.Close

======================
======================
======================

In the other tutorials linked below, we showed you how to set the login and logoff sounds in Windows 11:

How to Enable Logon Sound in Windows 11 (Using Task Scheduler):
   • How to Enable Logon Sound in Windows ...  

How to Enable Logon Sound in Windows 11 Pro, Enterprise Editions (Using GPEdit):
   • How to Enable Logon Sound in Windows ...  

How to Enable Logoff Sound in Windows 11 Pro, Enterprise Editions (Using GPEdit):
   • How to Enable Logoff Sound in Windows...  


The lock sound is played when you lock Windows without logging out to switch to another user or leave the system.

For better understanding, we'll enable the filename extensions.

The audio files required for this tutorial must be in .WAV format. You can use free online converters to convert mp3 to wave.



#howto #windows11 #locksound #unlocksound