如何在Windows 7和Vista中重置每个应用程序卷设置


Answers:


11

我发现了一种可行的解决方法,但是有点黑。我更喜欢一个更好的解决方案,但与此同时尝试:

将全局卷设置为最大,也将每个单独的应用程序卷也移到最大。然后将全局音量调低。它似乎正在工作。现在,所有应用程序卷设置都已绑定到全局设置。


对我不起作用。Last.fm客户端始终切换回最大值的〜15%。
罗伯特

4

我必须一直这样做->一直重置。我终于在网上搜索,看是否缺少一些秘密的热键或组合键。显然不是。:/

因此,我制作了一个autoit脚本来比人工完成更快:)我通过tools-> build对其进行编译,因此可以通过在开始菜单中搜索来运行exe。

这会导致所有滑块取消静音并达到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);

感谢此autoit线程提供有关移动滑块控件的信息。



3

Microsoft论坛Per4u3e的以下.bat文件对我有用。它的工作方式是暂时停止音频服务并修改注册表以将Windows重置为默认音频设置。

请注意,至少在Windows 10上,您可能需要以管理员身份运行脚本。

@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

2

Powershell重写了上面史蒂文(Steven)共享的答案,我在这里借用了一些漂亮的自我提升代码:https : //blogs.msdn.microsoft.com/virtual_pc_guy/2010/09/23/a-self-elevating -powershell脚本/

为什么?它的运行速度比批处理脚本快得多,我使用了很多。我想分享。:)

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

或者,如果您更喜欢没有粗略反馈文字或自我提升的信息,请执行以下操作:

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

1

我使用Ferrix的脚本已有一段时间,但我对其进行了修改,以将所有应用程序音量滑块设置为与当前主音量匹配,而不是将它们全部设置为50%。我还对其进行了更改,使其可以在音量设置小于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")

值得称赞的是Ferrix编写了原始脚本。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.