1

A little more than a week ago I made the terrible mistake of running sc delete AudioEndpointBuilder in the Windows command line. The consequences were truly disastrous.
I have no sound in my computer any more! How can I undo this apparently dangerous command?

A naïve attempt to just plainly run sc create AudioEndpointBuilder did not fix the problem.

1 Answer 1

2

Here are some suggestions.

  1. You can download and unzip the following cmd file at:
    https://user.it.uu.se/%7Ehesc0353/AudiosrvEndpointBuilder.zip

After unzipping, right-click it and choose Run as administrator.

If you ever get the question Overwrite (Yes/No)?, then I recommend that you always type n (for No) and hit Enter, because answering Yes means that you will overwrite the backup file that was supposed to make it possible to undo the changes in the registry – in case that is something you would want to do.

The content of the script is as follows:

@Echo off
:: ---------------------------------------------------------------------------------------
:: https://user.it.uu.se/%7Ehesc0353/AudiosrvEndpointBuilder.zip
:: ---------------------------------------------------------------------------------------
:: If you substantially alter this code - or use just small snippets of it -
:: please make sure to always leave the following 12 lines intact:
 Echo.
 Echo  DISCLAIMER.
 Echo  Read https://stackoverflow.com/legal/terms-of-service/public#warranties !
 Echo  Credit - https://superuser.com/users/1102737/henke
 Echo  This issue has caused me LOTS of frustration and that I have spent many, MANY hours
 Echo  hours on resolving it. So if this cmd file has been helpful, the best way to thank
 Echo  me is to upvote both the question and this answer - if you are allowed to.
 Echo     Link to answer - https://superuser.com/a/1585392
 Echo  (c) Copyright Henke 2022-05-05 - https://superuser.com/users/1102737
 Echo     This answer to How can I undo 'sc delete AudioEndpointBuilder'? is licensed
 Echo  under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
 Echo.
 Echo  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 Echo  =  If you DON'T want to run this file, hit CTRL + C, then y, then ENTER!  =
 Echo  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 Echo.
 Echo  If you WANT to run it, you need to right-click it and 'Run as administrator'.
 Echo.
:: ---------------------------------------------------------------------------------------
pause

:: Save a backup of the existing registry keys for AudioEndpointBuilder:
%SystemRoot%\System32\reg export^
 HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder^
 %SystemRoot%\BackupOfAudioEndpointBuilder.reg
:: Delete the existing registry keys for AudioEndpointBuilder:
reg delete HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /f
:: Create the registry keys for AudioEndpointBuilder:
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v Description /d^
 @^%%SystemRoot^%%\System32\AudioEndpointBuilder.dll,-205 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v DisplayName /d^
 @^%%SystemRoot^%%\System32\AudioEndpointBuilder.dll,-204 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v ErrorControl /t^
 REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v^
 FailureActions /t REG_BINARY /d^
 "80510100000000000000000003000000140000000100000060ea000001000000c0d401000000000000000000" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v Group /d^
 AudioGroup /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v ImagePath /t^
 REG_EXPAND_SZ /d "%%SystemRoot%%\System32\svchost.exe -k LocalSystemNetworkRestricted -p" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v ObjectName /d^
 LocalSystem /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v RequiredPrivileges /t^
 REG_MULTI_SZ /d SeChangeNotifyPrivilege /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v^
 ServiceSidType /t REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v^
 Start /t REG_DWORD /d 2 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder /v^
 Type /t REG_DWORD /d 32 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder\Parameters /v^
 ServiceDll /t REG_EXPAND_SZ /d ^%%SystemRoot^%%\System32\AudioEndpointBuilder.dll /f
reg add HKLM\SYSTEM\CurrentControlSet\services\AudioEndpointBuilder\Parameters /v^
 ServiceDllUnloadOnStop /t REG_DWORD /d 1 /f

:: Save a backup of the existing registry keys for Audiosrv:
%SystemRoot%\System32\reg export^
 HKLM\SYSTEM\CurrentControlSet\services\Audiosrv %SystemRoot%\BackupOfAudiosrv.reg
:: Delete the existing registry keys for Audiosrv:
reg delete HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /f
:: Create the registry keys for Audiosrv:
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v DependOnService /t^
 REG_MULTI_SZ /d "AudioEndpointBuilder\0RpcSs" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v Description /d^
 @^%%SystemRoot^%%\System32\audiosrv.dll,-201 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v DisplayName /d^
 @^%%SystemRoot^%%\System32\audiosrv.dll,-200 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v ErrorControl /t^
 REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v^
 FailureActions /t REG_BINARY /d^
 "80510100000000000000000003000000140000000100000060ea000001000000c0d401000100000020bf0200" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v Group /d^
 AudioGroup /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v ImagePath /t^
 REG_EXPAND_SZ /d "%%SystemRoot%%\System32\svchost.exe -k LocalServiceNetworkRestricted -p" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v ObjectName /d^
 "NT AUTHORITY\LocalService" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v RequiredPrivileges /t^
 REG_MULTI_SZ /d "SeChangeNotifyPrivilege\0SeImpersonatePrivilege\0SeIncreaseWorkingSetPrivilege" /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v^
 ServiceSidType /t REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v^
 Start /t REG_DWORD /d 2 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv /v^
 Type /t REG_DWORD /d 16 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv\Parameters /v^
 ServiceDll /t REG_EXPAND_SZ /d ^%%SystemRoot^%%\System32\Audiosrv.dll /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv\Parameters /v^
 ServiceDllUnloadOnStop /t REG_DWORD /d 1 /f
reg add HKLM\SYSTEM\CurrentControlSet\services\Audiosrv\Security /v Security /t REG_BINARY /d^
 "01000480c0000000cc00000000000000140000000200ac000600000000001400fd01020001010000000000051200000000001800ff010f0001020000000000052000000020020000000014008d010200010100000000000504000000000014008d010200010100000000000506000000000018008d000200010200000000000f0200000001000000000038008d000200010a00000000000f0300000000040000abace86417c3b0f1abc5110bd73b6dc89d8a33d21867214545351283ff23a71d010100000000000512000000010100000000000512000000" /f

:: Create the services:
sc create AudioEndpointBuilder binPath=^
 ^%%SystemRoot^%%"\system32\svchost.exe -k LocalSystemNetworkRestricted" type= share start= auto
sc create Audiosrv binPath=^
 ^%%SystemRoot^%%"\system32\svchost.exe -k LocalServiceNetworkRestricted" type= share start= auto

:Description
 Echo  Please note!
 Echo  - - - - - -
 Echo  '%0' created the AudioEndpointBuilder Audiosrv services
 Echo  in the registry and in services.msc.
 Echo.
 Echo   = = = = = = = = = = = = = = = = = =
 Echo   =  PLEASE RESTART YOUR COMPUTER!  =   I hope your Audio works now. (It should!)
 Echo   = = = = = = = = = = = = = = = = = =
 Echo.
 Echo  -  *  -  *  -
 Echo.
 Echo  Finished! - Press ENTER when you are ready to close this terminal window.
 Echo.
:: ---------------------------------------------------------------------------------------
pause

If the above script does not restore the sound in your computer, there might be problems with the file AudioEndpointBuilder.dll and/or with audiosrv.dll. Those two files are usually located in C:\Windows\System32\. They could be missing or have the wrong version(s) compared to your current build of Windows 10.
However, unless you have messed with these files, this is likely not to be the problem.

Another reason why the script does not get your sound back could be problems with your sound drivers. But I consider this to be unlikely also. In Device Manager look for Sound, video and game controllers. The easiest way to install the latest available drivers might be to let Windows Update do it for you.

  1. You can try upgrading to a later build of Windows 10. This is similar in effect to making a clean install of Windows 10. On my laptop with an HDD drive, this took about seven hours. See for example:
    Automatic Upgrade to New Windows 10 Feature Update
    How to Force Windows 10 to Install an Update
    Or make an online search, for example for :
    "Windows 10" "Update & Security" "Update Assistant".

  2. Hit Win ⊞+R, type cmd, hold down Ctrl+Shift and hit Enter. 1
    Then run :

DISM /Online /Cleanup-Image /RestoreHealth
  1. Make a clean install of Windows 10. By doing this, you will loose all software you have installed on your computer, so this should be considered a very last resort only.

References


1 Holding down Ctrl+Shift opens the command prompt as administrator.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .