How to reset per application volume setting in Windows 7 and Vista

18

5

I've altered per application volume settings for my applications. I want to reset every individual volume setting so that all apps use the global volume settings. How should I do that?

Mehrdad Afshari

Posted 2009-10-02T13:18:44.850

Reputation: 3 031

Related: How do I reset wave volume and overall volume to max?

– galacticninja – 2014-06-21T09:01:00.270

Answers

11

I've found a workaround that works but it's a bit hackish. I prefer a better solution but in the meantime try:

Set the global volume to maximum, move each individual application volume to maximum too. Then move the global volume down. It appears to be working. All application volume settings are now bound to the global setting.

Mehrdad Afshari

Posted 2009-10-02T13:18:44.850

Reputation: 3 031

Does not work for me. The Last.fm client always switches back to ~15% of the maximum. – Robert – 2011-03-25T18:53:59.133

4

I have to do this all-max -> reset all the time. I finally searched the net to see if there was some secret hot key or combo I was missing. Apparently not. :/

So I made an autoit script to do this more quickly than humanly possible :) I compiled it via tools->build and that way I can run the exe by searching in the start menu.

It causes all sliders to unmute and go to 50%.

Volume_Normalize.au3:

#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>

Func SlideTo($Win, $Ctrl, $Pct)

    If Not IsInt($Pct) Or $Pct < 3 Or $Pct > 100 Then
        SetError(1)
        Return False
    EndIf

   $CtrlHandle = ControlGetHandle($Win, '', $Ctrl)
   if not $CtrlHandle Then
      SetError(2)
      Return False
   EndIf

    Local $SetValue, $SendValue
    If $Pct <= 51 Then
        $SetValue = $Pct + 1
        $SendValue = '{UP}'
    Else
        $SetValue = $Pct - 1
        $SendValue = '{DOWN}'
    EndIf
    _GUICtrlSlider_SetPos($CtrlHandle, $SetValue)
    Local $PrevOpt = Opt('SendKeyDelay', 1)
    ControlSend($Win, '', $Ctrl, $SendValue)
    Opt('SendKeyDelay', $PrevOpt)

    Return True
EndFunc

Func EachSliderTo($Win, $Pct)

   WinWait($Win, "")
   If Not WinActive($Win,"") Then WinActivate($Win,"")
   local $i = 1
   If not WinActive($Win,"") Then WinActivate($Win,"")
   While True
      $Ctrl = "[CLASS:msctls_trackbar32; INSTANCE:"& $i &"]"
      if not SlideTo($Win, $Ctrl, $Pct) Then
         ExitLoop
      EndIf
      $i = $i + 1
   WEnd
   Return True
EndFunc

$Win = "Volume Mixer"
$Prog = "SndVol.exe"
if Not WinActive($Win,"") Then
   if not WinActivate($Win,"") Then
      ShellExecute($Prog)
      If not WinActive($Win,"") Then WinActivate($Win,"")
   EndIf
EndIf
WinWait($Win)
EachSliderTo("Volume Mixer",100);
EachSliderTo("Volume Mixer", 50);

Thanks to this autoit thread for info on moving slider controls.

ferrix

Posted 2009-10-02T13:18:44.850

Reputation: 41

On my Windows 10 desktop, I don't think this script is working as intended...

– Stevoisiak – 2017-04-18T23:04:43.150

3

The following .bat file from Per4u3e on the Microsoft Forums did the trick for me. It works by temporarily stopping audio services and modifying the registry to reset Windows to default audio settings.

Note that, at least on Windows 10, you may need to run the script as an admin.

@ECHO OFF

ECHO Reset Volume Mixer Settings...

NET STOP Audiosrv
NET STOP AudioEndpointBuilder

REG DELETE "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /F
REG ADD "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore"

NET START Audiosrv

Stevoisiak

Posted 2009-10-02T13:18:44.850

Reputation: 8 152

2

Bit of a Powershell rewrite of the answer shared by Steven above, I borrowed a bit from the nifty self elevating code here: https://blogs.msdn.microsoft.com/virtual_pc_guy/2010/09/23/a-self-elevating-powershell-script/

Why? It runs a lot faster than the batch script, and I use this alot. Figured I'd share. :)

If(!(new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
    $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"
    $newProcess.Arguments = $myInvocation.MyCommand.Definition
    $newProcess.Verb = "runas"
    $null = [System.Diagnostics.Process]::Start($newProcess)
    Return
}

cls
$ErrorActionPreference = "SilentlyContinue"

Write-Host '--- Reset Windows Audio Mixer ---' -ForegroundColor Cyan;""

Write-Host 'Stopping Service [Audiosrv]             : ' -ForegroundColor White -NoNewline
$Error.Clear()
Stop-Service -Name Audiosrv -Force
If($Error) {Write-Host 'Error' -ForegroundColor Red} Else {Write-Host 'OK' -ForegroundColor Green}

Write-Host 'Stopping Service [AudioEndpointBuilder] : ' -ForegroundColor White -NoNewline
$Error.Clear()
Stop-Service -Name AudioEndpointBuilder -Force
If($Error) {Write-Host 'Error' -ForegroundColor Red} Else {Write-Host 'OK' -ForegroundColor Green}

Write-Host 'Deleting Registry Key [PropertyStore]   : ' -ForegroundColor White -NoNewline
$Error.Clear()
Remove-Item -Path 'HKCU:Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore' -Force -Recurse
If($Error) {Write-Host 'Error' -ForegroundColor Red} Else {Write-Host 'OK' -ForegroundColor Green}

Write-Host 'Creating Registry Key [PropertyStore]   : ' -ForegroundColor White -NoNewline
$Error.Clear()
$null = New-Item -Path 'HKCU:Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\' -Name PropertyStore
If($Error) {Write-Host 'Error' -ForegroundColor Red} Else {Write-Host 'OK' -ForegroundColor Green}

Write-Host 'Starting Service [Audiosrv]             : ' -ForegroundColor White -NoNewline
$Error.Clear()
Start-Service -Name Audiosrv
If($Error) {Write-Host 'Error' -ForegroundColor Red} Else {Write-Host 'OK' -ForegroundColor Green}

Sleep -Seconds 5

Or, if you prefer it without the crude feedback text or self-elevation:

Stop-Service -Name Audiosrv -Force
Stop-Service -Name AudioEndpointBuilder -Force

Remove-Item -Path 'HKCU:Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore' -Force -Recurse
$null = New-Item -Path 'HKCU:Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\' -Name PropertyStore

Start-Service -Name Audiosrv

Pause

Alan McLaughlin Jr

Posted 2009-10-02T13:18:44.850

Reputation: 21

1

I have been using ferrix's script for some time but I modified it to set all application volume sliders to to match the current master volume rather than setting them all to 50%. I also altered it so that it works on sliders with volumes set less than 3%.

Volume_Normalize_Alt.au3:

#include <GuiConstantsEx.au3>
#include <GuiSlider.au3>

Func SlideTo($Win, $Ctrl, $Pct)

    If Not IsInt($Pct) Or $Pct < 0 Or $Pct > 100 Then
        SetError(1)
        Return False
    EndIf

    $CtrlHandle = ControlGetHandle($Win, '', $Ctrl)
    If Not $CtrlHandle Then
        SetError(2)
        Return False
    EndIf

    Local $SetValue, $SendValue
    If $Pct <= 51 Then
        $SetValue = $Pct + 1
        $SendValue = '{UP}'
    Else
        $SetValue = $Pct - 1
        $SendValue = '{DOWN}'
    EndIf
    _GUICtrlSlider_SetPos($CtrlHandle, $SetValue)
    Local $PrevOpt = Opt('SendKeyDelay', 1)
    ControlSend($Win, '', $Ctrl, $SendValue)
    Opt('SendKeyDelay', $PrevOpt)

    Return True
EndFunc   ;==>SlideTo

Func EachSliderTo($Win, $Pct)

    WinWait($Win, "")
    If Not WinActive($Win, "") Then WinActivate($Win, "")
    Local $i = 1
    If Not WinActive($Win, "") Then WinActivate($Win, "")
    While True
        $Ctrl = "[CLASS:msctls_trackbar32; INSTANCE:" & $i & "]"
        If Not SlideTo($Win, $Ctrl, $Pct) Then
            ExitLoop
        EndIf
        $i = $i + 1
    WEnd
    Return True
EndFunc   ;==>EachSliderTo

$Win = "Volume Mixer"
$Prog = "SndVol.exe"
If Not WinActive($Win, "") Then
    If Not WinActivate($Win, "") Then
        ShellExecute($Prog)
        If Not WinActive($Win, "") Then WinActivate($Win, "")
    EndIf
EndIf
WinWait($Win)

;Master volume has the highest instance number so find slider with highest instance then return its handle.
Local $i = 1
While True
    Local $h = ControlGetHandle($Win, '', "[CLASS:msctls_trackbar32; INSTANCE:" & $i & "]")
    If @error > 0 Then
        ExitLoop
    EndIf
    $i = $i + 1
    Local $Handle = $h ;store last sucessful handle to be returned
WEnd

Local $CurrMasterVol = _GUICtrlSlider_GetPos($Handle)

;100 is 0% and 0 is 100%
;EachSliderTo("Volume Mixer", 100) ;What is the point of doing this first?
EachSliderTo("Volume Mixer", $CurrMasterVol)
WinClose("Volume Mixer")

Credit goes to ferrix for writing the original script.

CyberKiller

Posted 2009-10-02T13:18:44.850

Reputation: 168