Every release of Windows since as far back as I can remember (Windows 3.1) has played a welcome sound at startup. In Windows NT-based systems, there is a startup sound as well as separate logon sound. A sound could also play when Windows logs off or when it shuts down. The user could assign all these sounds from Control Panel -> Sound. Starting with Windows 8, sounds for these events have been eliminated almost entirely. Let's see how to play the logon sound in Windows 10.
Why Windows 10 doesn't play the logon sound
In Windows 10, Microsoft focused on making Windows boot and shut down faster. Developers of the OS had completely removed the sounds which play at logon, log off and shutdown. Even if you assign sounds to the events for 'Exit Windows', 'Windows Logon' and 'Windows Logoff' or try to restore these events using the Registry, they will not play. There is the official statement from Microsoft which explains the situation.
"We removed these sound events for performance reasons. We pay a lot of attention to how quickly the machine powers on, powers off, goes to sleep, resumes from sleep, etc. As part of speeding this up, we experiment a lot with what process is in control of the startup and shutdown sounds. In an interim build of Windows 8 while it was under development, we were able to speed things up considerably by moving the shutdown sound from Explorer.exe (which is running while you’re still logged on) to Logonui.exe (which is the process that shows the "Shutting down" circle.)
However moving the shutdown sound this late started running into other problems. The code we use to play the sound (the PlaySound API) needs to read from the registry (to see what the preferences for this sound were) and from the disk (to read the .wav file), and we ran into issues where the sound was unable to play (or got cutoff halfway) because we had shut down the registry or the disk already! We could have spent time rewriting the API but we decided the safest and most performant thing to do was to eliminate the sound altogether."
The startup sound
The startup sound remained in Windows 10 but it is disabled by default. You need to enable it manually if required. See the following article:
Enable startup sound in Windows 10
Additionally, Windows 10 comes with a fast startup/hybrid boot feature. Due to this feature, when you click Shut down, it logs you out and hibernates the kernel and powers off; it doesn't really exit Windows. When you turn on your Windows 10 device again, it resumes from hibernate and logs in again. This is different from booting after a full shut down.
Even if you turn on the Windows startup sound, it will only play if you did a full shut down. It never plays when fast startup is on.
The logon sound
Here are instructions to revive the Logon sound. This is a sound that Windows plays when you sign in to your user account. It is a separate sound from the Startup sound mentioned above.
The procedure involves several steps. We need to create a special VBScript file which will play the sound, then create a task in Task Scheduler to play it at logon. Here is how.
Create a VBScript File to play the sound
- Open Notepad and paste the following lines into it.
Set oVoice = CreateObject("SAPI.SpVoice") set oSpFileStream = CreateObject("SAPI.SpFileStream") oSpFileStream.Open "C:\Windows\Media\Windows Logon.wav" oVoice.SpeakStream oSpFileStream oSpFileStream.Close
- Save this file anywhere with a .VBS extension. For example, "LogonSound.vbs".
- Double-click the file you've created and ensure that it plays your sound file.
This is a simple VBScript for Windows to play any sound using the Speech API. I prefer this method because it doesn't depend on loading some slow program such as Windows Media Player or any third-party app to play the sound.
In this script, I am using the default sound file, C:\Windows\Media\Windows Logon.wav. You can use any file you want. Just modify the appropriate line.
Tip: In the Notepad's Save dialog, include the file name to quotes to ensure that you are saving the file with the VBS file extension and not TXT.
Now we need to create a special Task Scheduler task to play this sound. Task Scheduler is able to run tasks at logon, so specifying our script as the task's action will make it play the sound every time you sign-in.
Play the Logon Sound in Windows 10
- Open Administrative Tools.
- Click the Task Scheduler icon.
- In the Task Scheduler library, click on the Create Task... link on the right.
- In Create Task dialog, fill in the Name box some meaningful text like "Play logon sound".
- Set the option Configure for: Windows 10.
- Switch to the Triggers tab and click on the New... button.
- Set the event for the trigger to At log on.
- Switch to the Actions tab and click on the New... button.
- In the next dialog, set the action type to Start a program.
- In the Program box, specify wscript.exe as the program.
- Type the full path to your VBScript file into the Add arguments text box.
- Switch to the Conditions tab and disable the option Start the task only if the computer is on AC power.
- Click on the OK button to create the task.
Note: If your operating system is preventing you from saving your task due to a blank password, you can add a password to your user account or disable the restriction in Local Security Policy under Administrative tools.
You are done!
This newly assigned sound will play when you log on. For extra sound files, check out the WinSounds.com web site. It comes with a large collection of sounds for Windows.
Tip: If you are running Windows 8 or Windows 8.1, check out this article.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Um.. in Windows 10, there’s literally a checkbox in Sounds to “Play Windows Startup Sound”.
Maybe have authors who have Microsoft certifications or at least basic investigation skills :)
I was expecting such comments.
First of all: Try to read the article before commenting!
Everything is explained in detail in the article. The Startup sound is NOT the logon sound. It is TWO different sounds.
This is clearly mentioned in the article, along with the link to ANOTHER article which mentions the STARTUP sound you are talking about.
Windows 10 1903 7-29-19
The Script for the sound trigger worked perfect.Hide and fast-I was looking for this cuz some scripts run with a screen.
The problem
After following all the steps from the tutorial.
The logon sound started when startup screen appears – Doing almost exactly the same thing as -Play windows startup sound- does but with a delay.
I tried with every user option and specific one in trigger tab (btw i have only one account)also modifying the privileges and changing -run logged on- or -logged on or not-
options but had no luck.
Solution
So i changed the trigger . Instead of -At log on- in TRIGGER tab i selected -On workstation unlock- and its pretty close to what i wanted.
Now everytime i log in the sound starts 8).
(I also tried -On an event- trigger
Protocol:Security
Source: none
Event-ID :4624
but it had a loop seconds after the music finished when log in)
Mine was working up until I installed my new virus scanner. Now I get
Script
C:\Windows\Media\CutstomizedSounds\LogonSound.vbs
Line: 4
Char: 1
Error 0x80045063
Code: 80045063
Source: (null)
It still plays but now I get a lot of overlap because I customized all my windows sounds so I got the logon sound playing and then I have the tone that plays when windows won’t let you do something.
how do i undo it?
Is there any way to turn on the SHUTDOWN sound along with the Log in and Log out sounds? I really can’t find a solution anywhere.
(BTW: I thought that you’ve owned and run the Winsound.com but I wasn’t completely sure until this article.)
I can’t click ”Any User” on step 7.
Help? When I follow these exact steps but use a different WAV file, I get an error from the VBScript on Line 4, Char 1. I even replaced the file in C:Windowsmedia, so it’s the exact same file path, the only thing that changed is the WAV file.
For me it was the WAV file. I had that same error with one WAV file, but not with the original Windows Logon WAV file or another WAV I had.
I fixed it by re-converting WAV to WAV using an online WAV converter.
Well, that was all fine and so and thank you for that vital information, because it was necessary. But it was not enough to work at my PC at least. So maybe, if there is anyoneelse who still had a problem after the above instructions : maybe this could help.
— TLDR:
Problem: Wrong Trigger
Solution: Right Trigger! Event: System/Kernel Power / 107
—
My Situation was:
The VBS script worked and played the wave file.
The task i created worked and started the VBS script which played the wave file.
But the trigger for the task did not work. The “Log on” after Hibernating seems to be a different “log on” from the “real log on”. Which means: i logged of my user account and logged in – and then the task + vbs worked fine and played the wave. But going to hibernate and comming back – no task started.
My Solution was:
I needed the right Trigger. This was an Event-Trigger. This had the configuration
Protocol: System
Source: Kernel-Power
Event-ID: 107
This is the Event-ID for reactivating windows from enegery-saving-mode, which hibernation counts to.
I found the ID with the Eventlogger and with the help of google.
I followed all of the steps and when I run it, I get a message saying There is no file extension in “C:\Users\MyUsername”
the path to the file must be incorrect.
When my system plays the sound it has heavy stuttering. Odd.
Same
It may be because the file size is too big. My first sound was ~350ko and i tested another which is ~130ko and it works fine. Hope this helps
Sergey: I went through the process twice. I still get the error message at log-in “no file extension” I typed it exactly as it shows in the file’s property box C:\Users\jawon\Documents\IMP DOCS\LogonSound.vbs. The second time I tried it with the quotation marks as you suggested in Step 3. Still no joy. I cannot see a method to copy/paste the path into the dialog box. Do you have any hints? Thank you … Jeff
To make sure you have the correct, like myself who had the wrong path, right click on the vbs file your using. Select properties. Location will give the path of where that specific file you right clicked properties on. Trying to navigate the path in file explorer can be misleading if your not as familiar with how pathing works.
This worked but it cuts out halfway through before resuming and playing it again :/
I get a Windows script host pop up every time I start up my laptop now
It asks me for a program to open the VBS file :/
This worked once I removed the “o” character from several places in script. However, once I put in a new path for the sound file, I received this error:
Script: C:\Mine\!!!Sounds\LogonSound.vbs
Line: 3
Char: 1
Error: File name of class name not found during Automation operation
Code: 800A01B0
Source: Microsoft VBScript runtime error.
Here was my final script:
Set Voice = CreateObject(“SAPI.SpVoice”)
set SpFileStream = CreateObject(“SAPI.SpFileStream”)
SpFileStream.Open “C:\!Mine\!!!Sounds main.wav”
Voice.SpeakStream SpFileStream
SpFileStream.Close
I got the same 800A010 runtime error even before I tried editing the script.
It worked for me
When I log on, it takes about thirty seconds to play the sound. Is there any way to make it run earlier?
Hi. There is no way. At least I don’t know any.
How do you enable the logoff sound in Windows 10?
This works great! BUT! It plays in mono even though the file is in stereo.
Is there a way to make it stereo?