• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Customization Startup Sound - Change in Vista

Cytherian

Vista Guru
Hoboken, NJ

Posts
538
Startup Sound - Change in Vista How to Change the Startup Sound in Vista
Tutorial on how to change the Vista startup sound, the one that is played when Vista first loads and presents the login screen. The Sounds theme control screen does not have an entry for customizing this.
Published by Cytherian Category: Customization 
#1
ByLine
How to Change the Startup Sound in Vista
Synopsis
Tutorial on how to change the Vista startup sound, the one that is played when Vista first loads and presents the login screen. The Sounds theme control screen does not have an entry for customizing this.
How to Change the Startup Sound in Vista

When you open the Sounds control panel and select the Sounds tab, you are presented with the current Sound Scheme and a list of sounds attached to program activities and various Windows events. You can play them and change them as you see fit, and even save this as a custom Sound Scheme.

Windows_SoundScheme-selection.PNG

You will notice that there are sound event entries for Windows Exit, Logon, and Logoff. But there isn't one for Start. The reason why is that Microsoft spent a lot of money paying Robert Fripp (of King Crimson fame) to come up with the sound, and they want to be sure that this signature sound is played every time Windows starts. Well, they do allow you to mute the startup sound, but you are not allowed to change it.

The nuts and bolts of it
In the System32 folder, there is a file called "imageres.dll", which contains the program instructions for Image Resources, as well as a majority of the system icons used in the operating system. It also contains the Windows Startup sound file (in WAVE format).

For those of you who are adept at hacking, you'll immediately recognize that there shouldn't be anything stopping you from changing this file. And that's correct. If you use a binary resource editor, like Resource Hacker, you can easily replace this part of the file. For those of you who haven't a clue and/or might be uneasy about modifying it, there is a program available to assist. It's called "Startup Sound Changer", authored by WinAero. It's a very simple utility that does not install itself on your computer--you just execute it directly. It will not only play for you the current sound and allow you to replace it with an alternative wave file, you can also restore the original.

The caveat
So it should be easy to do this, yes? Well, yes and no. There is a ramification with modifying this file. Vista has an elaborate file version checking and control system to help avoid messy problems of files being corrupted or unduly changed by either undisciplined or rogue software. If you change this file, you will find that after you reboot the 2nd time, the "imageres.dll" file will have been reverted back to the original. OK, no problem then, you can just create a script that will force replacement just before you shut down your computer, right? Well that will work, but it certainly isn't neat or elegant. And if Microsoft ever decides to change this file, you'll have to make your changes to the new version (but thankfully, Microsoft has yet to change it even after 2 service packs).

The relevant details on imageres.dll
Imageres.dll has two primary versions: one for 32 bit and one for 64 bit. Both are on your computer if you are running 64 bit, but only one will exist in the \Windows\System32 folder (obviously the one that matches your operating system bit type).

Here is the rundown on imageres.dll residency (all under \Windows):
  • .\System32 - the primary location of the current version.
  • .\SysWOW64 - the 32 bit compatibility location, which is present on 64 bit versions.
  • .\Winsxs\amd64_microsoft-windows.. - a long folder name with this prefix, for the 64 bit version. An example:
    "amd64_microsoft-windows-imageres_31bf3856ad364e35_6.0.6000.16386_none_36a57cbab3586699"
  • .\Winsxs\x86_microsoft-windows.. - a long folder name with this prefix, for the 32 bit version.
  • .\Winsxs\Backup - the backup location, where the file will have a cryptic name with a prefix of "amd64_microsoft-windows" or "x86_microsoft-windows", but "imageres" will be embedded inside it. An example:
    "amd64_microsoft-windows-imageres_31bf3856ad364e35_6.0.6000.16386_none_36a57cbab3586699_imageres.dll_44f44625"
In the 64 bit version, Microsoft keeps both versions in case there is a 32 bit application that will be installed in the environment. While the 64 bit version resides in System32 (I know, you'd expect System64 -- it's a long story), the 32 bit version resides in SysWOW64 (you'd expect SysWOW32, right?). You may also notice, if you search on imageres in these folders, is that the files are of the same size. They actually do possess different information inside them though, so it would be a mistake to assume the files are identical (I made this mistake myself and had problems with resolving SFC errors).

OK, well, what are the ramifications if the altered imageres is not in Winsxs? What will happen is that after you reboot, Windows will detect the unexpected file and replace it from one within the "store" (Winsxs). This means that you'll have to replace the file every 2nd time you reboot. Also, if you run SFC /scannow, which is something one should do from time to time in conjunction with system maintenance, errors will be flagged on the imageres.dll file and it will be replaced. From an operational standpoint, the file would still work correctly if it wasn't replaced. But Windows will replace it. That is, unless the store copy is altered as well.

The workaround
One might argue that modifying imageres.dll is not the right thing to do and it should be left alone. No 3rd party application would be touching this file anyway. It belongs to Microsoft and should be off limits. But if you know that the file is sound, aside from the WAVE file replacement, then it should be perfectly fine. Here's what you should do:
  1. Make a backup of the imageres.dll files to be replaced. I suggest doing this with the replicated folder structure, then zipping this up into a single archive file.
  2. Modify the imageres.dll file, using a resource editor or a specialized 3rd party program.
  3. Replace \System32\imageres.dll with the modified version
  4. Replace \Winsxs versions of imageres.dll that are applicable to your Vista installation (32 bit or 64 bit). Note that in the \Winsxs\backup folder, you should make sure the cryptic name matches the original.
  5. Replacement can be done manually, assuming you take ownership of the original files, rename them to something ".bak", then rename the new version as the original name. It can also be done automatically using the Robocopy command.
The Robocopy command is the safest and easiest way to make the change, because you don't have to struggle with denied file access permissions and executing is a single step (from the Windows Repair command line option when booting from your operating system installation disc). Essentially you replicate the folder structure of where the files will be placed with file copies inside, and give it an alternate root name "e.g. modfile". So for example, you'll create "C:\modfile\Windows\System32" and "C:\modfile\Windows\Winsxs" folders with respective sub folders and the files copied to the corresponding places. Then after booting up in repair mode from your installation disc, in Robocopy you will reference this folder with the command line entry as follows: "robocopy c:\modfile c:\ /E /IS" (notice "modfile"; you would use whatever name you chose, if you didn't use this one). You will see a copious amount of output as file folders are traversed (winsxs is huge). It will take a few moments and then at the end you will see a status report of what took place, and you should see the "failed" counter reading zero. After this, reboot (and remember to take your installation disc out of your DVD drive).

After you do this, SFC /scannow will still find a problem (it must get the reference hash code from somewhere else, instead of the backup file in Winsxs), but it will find the store file to be faulty as well and so it won't replace it. Your computer will still function normally.

Alternatively, you could avoid changing your DLL store in Winsxs and just keep the Startup Sound Change utility handy to make the change again in the future, if it gets inadvertently switched back again (by running SFC /scannow or some other Windows maintenance done by Update).

And that's all there is to it. Again, keep the originals as a backup in a zipped up archive that contains the folder structure for easy replacement. If you see any discrepancies with what I've posted or have some suggestions, feel free to post about them. Thanks!


DISCLAIMER: This tutorial is provided only as a suggested guide to modifying the imageres.dll file. I take no responsibility if you make a mistake and corrupt your system. Obviously the most important thing to do with any modification like this is to back up your system accordingly (at the bare minimum, ensure you have a restore point, but also make a full system backup).

Footnote: A big thanks to Tom982, who helped me through the struggle of having replaced imageres.dll incorrectly and got my system back to 100% integrity. Thanks Tom! :cool:


 
Last edited by a moderator:

My Computer

System One

  • Manufacturer/Model
    HP Pavillion dv5t
    CPU
    Intel Core Duo 2.53GHz
    Memory
    4Gb
    Graphics Card(s)
    NVidia GeForce 9600M GT 512Mb
    Screen Resolution
    1280x800 32bit
    Hard Drives
    Seagate Momentus XT 500Gb
    Hitachi Travelstar HTS543225L9A300 250Gb
    Mouse
    Microsoft 4000