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 can also play when Windows logs off or when it shuts down. You can assign all these sounds from Control Panel -> Sound. But in Windows 8, sounds for these events have been eliminated almost entirely. Let's see how to revive them.
In Windows 8, Microsoft focused on making Windows boot and shut down faster and so they 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. I contacted Microsoft for a clarification and here is what they replied:
"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 remained in Windows 8 but it is disabled by default. You need to go to the Sound Control Panel -> Sounds tab and check the option "Play Windows Startup sound".
Additionally, Microsoft introduced fast startup/hybrid boot in Windows 8. 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 8 PC 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. So what is the solution? The trick is to simply use the Windows event log system to play the sounds now.
Before you proceed
I decided to create Startup Sound Enabler for Windows 8. This app will allow you to assign a startup sound with just one click! It does the job of creating the script with the sound you pick and setting it up in Task Scheduler automatically.
The application has a very simple UI: click the Set Startup Sound button to set the startup sound, click Disable Startup Sound to disable it.
Get Startup Sound Enabler for Windows 8
Here are step-by-step instructions to revive the Logon sound: (You can use the same method to assign sounds for log off and shutdown events)
- Open Notepad and paste the following lines into it. (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 bloated and slow program such as Windows Media Player just to quickly play one sound and close it):
Set oVoice = CreateObject("SAPI.SpVoice") set oSpFileStream = CreateObject("SAPI.SpFileStream") oSpFileStream.Open "C:\Windows\Media\Windows Logon.wav" oVoice.SpeakStream oSpFileStream oSpFileStream.Close
Tip: Note the sound I used in this script. It is a lovely new sound included in Windows 8 located at C:\Windows\Media. You can change it to any other .WAV sound you want.
Tip: If you are wondering, where you can find some quality sounds, look no further than this article.
- Save this file anywhere with a .VBS extension. For example, "Logon Sound.vbs"
Tip: You can add the filename and extension inside quotes, so that Notepad does not add ".txt" to the filename that you have typed. Adding it inside quotes will save it as "Logon Sound.vbs" and not, "Logon Sound.vbs.txt".
- Now we need to find some appropriate event to associate this sound. Open Event Viewer by typing: Eventvwr into the Run dialog, or on the Start screen.
- Open Event Viewer opens, expand the 'Windows Logs' category and click the 'System' log.
- Now click the Action menu and click Find...
- In the Find what: text box, type: 7001 and press Enter or "Find Next" button. The Winlogon event will be selected.
(7001 is the Event ID for one of the many events which gets logged into the Event Log when you log on to Windows)
- Now right click this event and click 'Attach Task to This Event...'
- The 'Create Basic Task Wizard' window will open.
- Type a descriptive name if you want such as "Logon sound" and click Next. Typing a name is optional, so it's easier to locate this task later if you need to delete it.
- Click Next again and then choose 'Start a program' and Next again.
- In the Program/script: field, type: WScript.exe. In the Arguments field, enter the path to the file you saved. For example, "C:\Windows\Logon Sound.vbs" (make sure you use double quotes if your path contains spaces or long file names)
- Check the box called "Open the Properties dialog for this task when I click Finish" Then click Finish to create the task.
- Optionally, go to the Conditions tab and uncheck "Start the task only if the computer is on AC power", if you want the logon sound to play even when your Windows 8 PC or tablet is running on batteries.
- Click OK and close Event Viewer.
- Now try shutting down Windows from the Settings Charm (Win+I), or by pressing Alt+F4 on the Desktop, or from your favorite Start Menu replacement such as Classic Shell.
- The next time you log in, the sound should play.That's it! You just revived your logon sound. The startup sound will still play when you do a full shut down and this newly assigned sound will play when you log on. You can use this same method to find some appropriate events in the Event Log for shutdown and log off and assign different sounds to them by creating another script.Be sure to check out WinSounds.com for a large collection of free, downloadable sounds.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!
61 thoughts on “How to play the logon or startup sound in Windows 8.1 or Windows 8”
Maybe this works fine with very short sounds, but unfortunately the item I want to hear after logon, sounds very choppy.
It sounds just fine in Windows 7 after logon, but not in Windows 8.1 using the method described here.
It sounds just as choppy if I run the VBScript from Windows, so delaying the task won’t help.
Too bad. I was really hoping to have finally found the solution to bringing back functionality that Microsoft has removed.
Guess I’ll have to keep looking.
This is the 1m09s of music that I’ve used to test the logon sound:
Guys i get an error while the system starts in the script on line 4
please help me with this. thanks in advance.
After some testing I can now confirm that the method described here works. No matter how long or large the .wav-file is.
Apparently though the .wav-file used must have codec pcm_s16le to work. The file I mentioned in my previous post (the one that sounded choppy) had codec pcm_u8. After converting it to pcm_s16le it now works.
So thanks to the author for giving us this “How to…”
Thank you too for your useful comment.
Не самое лучшее решение загружать систему при запуске VBS скриптами но лучше так чем совсем никак. В очередной раз даюсь “диву” корпорации меломягких которые с каждым выпуском (если быть точным то я имел в виду Windows 10 PRO 20H2) ос усложняют жизнь рядовым пользователям отключив настройки звуковой схемы для некоторых событий в реестре ) и спрятав в другую runtime библиотеку ресурс звука событий , в результате чего функция изменения звука запуска в WinaeroTweaker более не работает в ос Windows 10 20H2 увы :-( :-(
В 19.1 тоже не работает?
Если нет – будем посмотреть.
First let me say I have no experience with vbscripting…. that being said… I followed your instructions to the letter… could get the file to play a sound.. tried to get the vbs script to execute just by clicking on it… finally got that to work… but the WScript procedure would not work … could create the event and it was there when checked in the Task Scheduler and would run from the task scheduler but showed never having been run before. I was able to make a shortcut to the Startup folder and the startup sound works great…. but I’m still left with a shutdown script that I can’t assign to event and get to work… any suggestions (thanks for your time….this the first bit of information on this topic that works)
Actually if it plays without delay by placing in the startup folder, then good for you. I recommended the Event Log way because shortcuts in the startup folder start very late on Windows 8. You could also use Group Policy (Gpedit.msc) -> Windows Settings. It has Logon/Log off scripts as well as Startup/Shutdown scripts.
Could someone please tell me the Event IDs for shutdown and log off? I can’t seem to find them.
Sure, I will do it later this day.
For logoff, event ID is 7002. For hybrid shutdown, event ID is 1074. For entering sleep/hibernate, event ID is 42. For resuming from sleep/hibernate, event ID is 1.
Thank you, I appreciate it.
My log off and Hybrid shutdown sound scripts won’t work at all. Are you sure that the Event ID for log off is 7002 and for Hybrid shutdown is 1074? Also my log on sound does work but it starts late after log on like a few minutes or longer. How do I make it start close to actual log on? I’m using Windows 8.1 64 Bit Home Premium Edition. Please help me ASAP! Thanks :)
Hey Gaurav Kale, I have two problems. One is that my log on sound DOES work but it happens very late into log on like a few minutes or longer. How do I make it happen close to actual log on time? Second problem, my log off, and Hybrid ShutDown sound scripts don’t work AT ALL PERIOD! Are you sure that the log off ID is 7002 and that the Hybrid shutdown is 1074? Please re check for me. By the way I’m running Windows 8.1 64 Bit Home Premium Edition, or whatever the basic Windows 8.1 is called. Not sure if I have the Update One or Bing Windows 8.1 or just Windows 8.1, but I upgraded my computer to the free Windows 8.1 from the Windows Store, and I’m using HP with 2 GB of RAM, (1.57 GB Useable, I have a AMD dual Core Processor with 1.40 GHZ, and it has Radeon HD graphics which are on board. Hope that helps and please help me ASAP! Thanks :)
How may we delete the task is it doesn’t work? My task couldn’t find the file, even though I had the path right. I had to do a system restore to eliminate the task error sound every time I logged on. Is there an easier way to do the delete? My system is Windows 8.1 Pro 64-bit.
In Task Scheduler, there is a separate category of Event Viewer Tasks. Expand “Task Scheduler Library” and click the Event Viewer Tasks item. There, you will be able to see the Task you created. Right click it and select Delete.
Instructions weren’t specific enough. There is no Event Viewer Tasks under Task Scheduler. Please elaborate one where I have to go to find this.
Really? We must do all of this to play a simple sound in Microsoft OS that has been there forever? Unbelievable… makes me want to seriously start looking a t MAC…. or just use my old Dell Windows 7 Laptop instead.
Only if you need to play it.
It didn’t want to work for me so I gave up and just assigned the logon logoff sounds to skype. It’s not entirely on time with the logon sound, but when I log off, Skype is the last thing to shut down, so it works.
Hi,…this method actually worked for me ^_^
I have put the sound of the Aventador’s ignition,and my picture password is of the aventadors ignition switch
but the sound plays roughly about 7 seconds after i login…now thats too slow for a lamborghini :p .So i want it to play as soon as i log in..Solution please . ^_^ . Thank you
It works for me. but will you telling me how to delete the task in case I want to restore it?
This works great for Windows startup but I want the sound to also play whenever the account is logged into. For example, after sleep/hibernate, or resuming from a Win+L lock.
Would it be done the same way? If so, do you know the event ID for that particular action?
get an error while the system starts in the script on line 4,help plz
Commend from above:
Apparently though the .wav-file used must have codec pcm_s16le to work
there is a error in line 4 displaying whenever i try to open the vbs file. how do i fix this ?
My comments aren’t showing up. Is there like a waiting period or have to have a Mod approve the comment before the post is displayed? If there is, then sorry for the triple post (including this one).
Hey Gaurav Kale, are you sure that the Event ID for log off is 7002, and 1074 for hybrid shutdown? Because my log off script and Hybrid shutdown script isn’t working at all period. Please check to make sure you have the correct Event ID’s. Also my login sound takes a while to start after logging in, sometimes even a few minutes. When I just logg off and back on, it’s usually like 20 seconds, but when doing a full or hybrid shutdown, or restart, it takes quite a while. How do I make it to sound close to actual log in? I’m running Windows 8.1 on an HP Desktop. Please help me ASAP. Thanks :)
Oh, and it’s also 64 Bit
Also it’s Home Premium Edition or whatever the basic is. It’s NOT Professional, or Enteprise, or anything like that, it’s build 9600, and I have a dual core AMD Processor with 1.40 Ghz, and it is HD Radeon Graphics which are on board. It also has 2 GB of RAM (1.57 GB Useable.) Hope that helps.
Yes the event ID is correct and the script works for me. You can look up the event ID yourself using Event Viewer. I don’t know of a way to control how sooner or later the sound plays.
Very smart :-) I chose to tie the events to predefined task triggers instead: Logon, Lock and Unlock. And I added a line to put the script whereever I want and a line to accept the soundfile as a parameter.
Home = CreateObject( "Scripting.FileSystemObject" ).GetParentFolderName( WScript.ScriptFullName )
Sound = WScript.Arguments.Unnamed( 0 )
Set oVoice = CreateObject("SAPI.SpVoice")
set oSpFileStream = CreateObject("SAPI.SpFileStream")
oSpFileStream.Open Home & "\" & Sound & ".wav"
Then I call
%systemroot%\system32\wscript.exe(I prefer full paths, obviously :-)) with
//b "%windir%\Media\PlaySound.vbs" "Windows Logon"(for example…)
Thanks again for this post!
How does your script work? It doesn’t seem clear to me?
Did not work for me , i might have written the script path wrongly and now im getting Windows Script Host error path not found whenever i start up ! PLEASE HELP !! advice ! i can no longer see the task in task scheduler but still happen
Awesome job. Very handy script, worked like a charm!
Win 8.1 x64 It works !!! Thank U !!! It`s cool ! Thank`s !
I need to delete these tasks! they are not working please please explain further how to delete them :)
wow.. works like a charm. :) sadly though, scripts for logoff and shutdown doesnt work. so yeah. maybe you could look into it cause i tried attaching the tasks to the event id’s you mentioned in the comments.. also looked around the net for event id’s concerning log off and shutdown. well.. doesn’t work.
oh and for those who wants to delete the task, search for schedule tasks in the start menu. under settings tab. extend the “task scheduler library” at the left pane. under it you’ll see “event viewer tasks”. you’ll find your attached tasks there.
Hi again, it’s been a while. I was the one who couldn’t get the log off sound or shut down sound to work, only the log on sound. Well I have now just purchased a over $1200.00 PC from CyberPowerPC and it has really great specs, 750 Ti Video Card, 120 GB SSD, 1 TB HDD, 8 GB of Ram, Intel i7 4790K Quad Core Hyper Threaded 4.0 GHz Processor, and Windows 8.1 Bing 64 Bit Home Premium Edition Update 1 installed, and I STILL can’t get the Log off or shut down sounds to work, only the log on sound, so would you PLEASE do us a HUGE favor and make a log off sound enabler, and a shut down sound enabler just like you did with the log on sound enabler?! I would REALLLLLLY appreciate it! Thanks for any help/advice given. :)
I have done as you have stated but I have one problem. It seems that there are a few others who have the same problem. I get a runtime error of 800A0005 for Line 4 Char 1. A little help here please?
In fact error says wav file contains ‘invalid characters’ which means some wav files under Themes directory are either corrupted or old fashioned in some way. As a workaround I opened a non-working wav file with Audacity and exported as wav file again then replaced the old file with the newly created one and voila! Everything worked perfectly :)
PLEASE HELP!!!! i messed up and now whenever i login i get the annoying window popping up asking me to choose a program to open the .wav file with. please tell me where to find these events and delete/disable them. Thanks
Just delete the task in Task Scheduler.
I got this working, but there’s a rather long delay between logging in and the sound playing, is there a way to fix this?
Does anyone else know why only the logon sound scripts work but not the logoff or shutdown sounds? Even creating scripts for those STILL doesn’t work! Why are those two particular sounds refuse to play? Can someone help [lease? Thanks :)
I discovered that the script might not run if it is not in SYSTEM32, the first time i tried to run the script i got an error saying it wasn’t found in system 32 but i fixed it.
So when i want to do the logoff or shutdown sounds you said to use the same method if i do don’t that just change the startup sound i just made if its the same method? what changes need to be made in the this method when making shutdown sound??
also how do i get rid of it if i don’t want it anymore?
because after this i did the reg tweak to enable sounds so i can change them can i change the logon sound though there after this method or will there be a conflict?
BTW it didn’t work :(
All of this seems to refer to changing the LOGON sound, BUT I thought we were all looking to change the STARTUP sound!? If you would be soooo very kind, would you make a “StartupSound.vbs” file for me with step-by-step directions for adding this? I have NO idea what the Startup sound code is in Event Viewer. This would all be greatly appreciated! Spent far too many hours and days trying to change my startup sound with NO success.
The Start sound is in Sounds Settings -> Play statup sound checkbox
how can i find the activity that I created
this worked great, thank you! I can’t wait for a shutdown sound enabler now!
Does this app work in Windows 10? I‘ve Fast Startup disabled and ‘Play Windows Startup sound’ checkbox marked but I don‘t hear the default sound from imageres.dll after starting my OS. I‘ve auto login disabled.
Well, at least manual setting still works.
I can get the sound to work but, to use my own sound clip it does not seems to play.
I get the following error: Line: 3
This here is what I have as the script.
Set oVoice = CreateObject(“SAPI.SpVoice”)
set oSpFileStream = CreateObject(“SAPI.SpFileStream”)
oSpFileStream.Open “C:\Windows\Media\Windows Welcome back commander.wav”
How can I delete the one that I already modify at Event Viewer? It seems like this method cannot be applied on my laptop (Windows 10). It throws me Windows Script Host error every time I start my laptop. It said that There is no script engine for file extension “.wav”. When I attach task at Event 7001, I just leave the name with it’s default name System_Service Control Manager_7001 and give some description of it (created successfully), but now I cannot find it back by typing it’s name.
Set Sound = CreateObject(“WMPlayer.OCX.7”)
Sound.URL = “C:\Users\FBI\Downloads\Music\win.wav”
do while Sound.currentmedia.duration = 0
followed instructions to the letter, wrong sound plays on startup, then when i get to desktop, i get, no script associated with .wav
i have no idea what this means.
Microsoft VBScript Runtime Error
File name or class name not found during automation