Windows 레지스트리를 통해 Windows의 사운드 구성표 변경

Windows 레지스트리를 통해 Windows의 사운드 구성표 변경

레지스트리를 편집하여 기존 사용자의 사운드 구성표를 "소리 없음"으로 변경하려면 어떻게 해야 합니까? 새로 설치된 창에 필요한 모든 조정 사항이 포함된 .reg 파일을 만들고 있는데 사운드 구성표를 변경하는 데 어려움을 겪고 있습니다.

답변1

계획을 변경하는 것은 비교적 쉽습니다. 그러나 그런 다음에는적용하다좀 더 복잡한 새로운 계획입니다.

"소리 없음" 구성표의 이름은 .None; 를 탐색하면 이를 볼 수 있습니다 HKEY_CURRENT_USER\AppEvents\Schemes\Names.

선택한 구성표는 HKEY_CURRENT_USER\AppEvents\Schemes에 있으며 기본값은 입니다 .Default. 따라서 이를 다음과 같이 변경하여 선택한 구성표를 설정할 수 있습니다 .None.

New-ItemProperty -Path HKCU:\AppEvents\Schemes -Name "(Default)" -Value ".None" -Force | Out-Null

그러면 선택한 구성표가 (기술적으로) 설정됩니다. 이는 사운드 설정으로 이동하여 구성표가 No Sounds선택되었는지 확인할 수 있습니다. 그러나 이벤트 사운드는 계속 재생됩니다. 이는 선택한 구성표가 아직 설정되지 않았기 때문입니다.적용된.

사운드 구성표를 적용하려면 적절한 조치는 다음과 같습니다.

  • 일치하는 각 앱 이벤트에 대해 라는 HKEY_CURRENT_USER\AppEvents\Schemes\Apps\*\*하위 키에 새 구성표 이름의 하위 키를 복사합니다 .Current.

예를 들어 시스템 느낌표 이벤트에 소리 없음 구성표를 적용하려면 을(를) 복사 HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemExclamation\.None합니다 HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemExclamation\.Current.

그러나 귀하의 경우 "소리 없음" 테마를 적용하고 있으므로 모든 값을 지울 수 있습니다. 이는 한 줄로 수행할 수 있습니다.

Get-ChildItem -Path "HKCU:\AppEvents\Schemes\Apps" | Get-ChildItem | Get-ChildItem | Where-Object {$_.PSChildName -eq ".Current"} | Set-ItemProperty -Name "(Default)" -Value ""

단계별:

  • Get-ChildItem -Path "HKCU:\AppEvents\Schemes\Apps"모든 앱을 가져옵니다.
  • Get-ChildItem모든 앱 이벤트를 가져옵니다.
  • Get-ChildItem각 구성표에 대한 모든 앱 이벤트 사운드 설정을 가져옵니다.
  • Where-Object {$_.PSChildName -eq ".Current"}현재 적용된 모든 앱 이벤트 사운드 설정을 선택합니다.
  • Set-ItemProperty -Name "(Default)" -Value ""해당 사운드 설정을 지웁니다.

좀 더 자세히 알아보려면:

아래의 키 HKEY_CURRENT_USER\AppEvents\Schemes\Apps는 앱이며 기본값은 표시 문자열인 것으로 보입니다. 내 시스템에 있는 항목은 .Default("Windows"), Explorer("파일 탐색기") 및 sapisvr("음성 인식")입니다.

각 앱 키 아래의 키는 해당 앱의 앱 이벤트입니다.

각 앱 이벤트 키 아래의 키는 각 사운드 구성표에 대해 재생할 사운드입니다. HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemExclamation\.None소리 없음 구성표를 사용할 때 Windows 시스템 느낌표에 대해 재생되는 사운드도 마찬가지 이고 HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\SystemExclamation\.DefaultWindows 기본 구성표를 사용할 때 Windows 시스템 느낌표에 대해 재생되는 사운드도 마찬가지입니다.

또한 .Current이 레벨에는 재생되는 실제 사운드에 대한 키가 있습니다. 아마도 UI에서 새 구성표를 선택하면 해당 .Current값에 대해 각 설정이 개별적으로 복사됩니다.

답변2

방금 이 스크립트를 만들었습니다. 사용에 따른 책임은 본인에게 있습니다.

if (-Not (Test-Path 'HKCU:\AppEvents\Schemes\Names\.None'))
{ 
    New-Item -Path 'HKCU:\AppEvents\Schemes\Names' -Name '.None'
    New-ItemProperty -Path 'HKCU:\AppEvents\Schemes\Names\.None' -Name '(Default)' -Type 'String' -Value 'No Sounds'
}

Get-ChildItem -Path 'HKCU:\AppEvents\Schemes\Apps\.Default' | Select Name | ForEach-Object {
    $thing = $_.Name -replace "HKEY_CURRENT_USER", "HKCU:"
    $fullnun = "$thing\.None"
    if (-Not (Test-Path $thing))
    {
        New-Item -Path $thing -Name '.None'
        echo "$thing\.None created"
    } else {
        echo "$thing\.None already existed"
    }

    if (Test-Path($fullnun))
    {
        New-ItemProperty -Path $fullnun -Name '(Default)' -Type 'String' -Value ''
    }
}

Set-ItemProperty -Path 'hkcu:\AppEvents\Schemes' -Name "(Default)" -Type "String" -Value ".None"

답변3

사운드 구성표를 'NO SOUND'로 설정하는 코드는 다음과 같습니다.

Write-Host " Setting Sound Schemes to 'No Sound' .." -foregroundcolor Gray -backgroundcolor black

$Path = "HKCU:\AppEvents\Schemes"

$Keyname = "(Default)"

$SetValue = ".None"

$TestPath = Test-Path $Path
if (-Not($TestPath -eq $True)) {
   Write-Host " Creating Folder.. " -foregroundcolor Gray -backgroundcolor black
   New-item $path -force
}

if (Get-ItemProperty -path $Path -name $KeyName -EA SilentlyContinue) {

   $Keyvalue = (Get-ItemProperty -path $Path).$keyname

   if ($KeyValue -eq $setValue) {

       Write-Host " The Registry Key Already Exists. " -foregroundcolor green -backgroundcolor black


   }
   else {

       Write-Host " Changing Key Value.. " -foregroundcolor Gray -backgroundcolor black

       New-itemProperty -path $Path -Name $keyname -value $SetValue -force # Set 'No Sound' Schemes
       Get-ChildItem -Path "HKCU:\AppEvents\Schemes\Apps" | # Apply 'No Sound' Schemes
        Get-ChildItem |
        Get-ChildItem |
        Where-Object { $_.PSChildName -eq ".Current" } |
        Set-ItemProperty -Name "(Default)" -Value ""

       Write-Host " The Registry Key Value Changed Sucessfully. " -foregroundcolor green -backgroundcolor black
   }

}
else {

   Write-Host " Creating Registry Key.. " -foregroundcolor Gray -backgroundcolor black

   New-itemProperty -path $Path -Name $keyname -value $SetValue -force
   Get-ChildItem -Path "HKCU:\AppEvents\Schemes\Apps" |
       Get-ChildItem |
       Get-ChildItem |
       Where-Object { $_.PSChildName -eq ".Current" } |
       Set-ItemProperty -Name "(Default)" -Value ""


   Write-Host " The Registry Key Created Sucessfully. " -foregroundcolor green -backgroundcolor black
}

관련 정보