Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Realtek UWP Settings Export and Import
# Backup and restore your Realtek Audio settings.
# github/icedterminal
# v1.0.2
# ==============================================================================================================
# DOWNLOADING THIS SCRIPT:
# While this script is clearly safe, Windows may block this file. You will need to unblock it if that's the case.
# Additionally, PowerShell blocks scripts for safety. Run the command: set-executionpolicy unrestricted
# You can revert this change with the command: set-executionpolicy restricted
#
# COPYING AND PASTING THIS SCRIPT:
# Copy and paste into an empty notepad window. Save it as "what_ever_you_want_to_name_it.ps1".
# This will bypass the need to change execution policy and unblock files.
# Right click this file and select "Run with PowerShell"
#
# ABOUT
# Backup and restore your realtek audio settings.
# When asked for a path to the .reg file, SHIFT Right-click the file and click "Copy as path"
# Check for admin
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Function Menu {
Clear-Host
Do {
Clear-Host
Write-Host '====================================' -ForegroundColor Yellow
Write-Host 'REALTEK UWP SETTINGS EXPORT/IMPORT' -ForegroundColor Yellow
Write-Host '====================================' -ForegroundColor Yellow
Write-Host '1. Export Settings'
Write-Host '2. Import Settings'
Write-Host 'Q. Quit'
Write-Host $errout -ForegroundColor Red
$Menu = Read-Host -Prompt 'Please enter an option'
switch ($Menu) {
1 {
Write-Host "`nExport settings selected."
Write-Host "`nLoading hive..."
reg load HKU\RTK "$env:LocalAppData\Packages\RealtekSemiconductorCorp.RealtekAudioControl_dt26b99r8h8gj\Settings\settings.dat"
Write-Host "`nSaving to desktop..."
reg export HKU\RTK\LocalState\EQ "$env:userprofile\Desktop\RealtekEQBackup.reg"
Write-Host "`nUnloading hive..."
reg unload HKU\RTK
Write-Host "`nDone!"
start-sleep 3
}
2 {
Write-Host "`nImport settings selected."
Write-Host "`nInput the location of your backup .reg file."
Write-Host "Example: `"C:\Users\demo\Desktop\RealtekEQBackup.reg`"" -ForegroundColor Green
$location = Read-Host -Prompt 'Type or paste path'
Write-Host "`nLoading hive..."
reg load HKU\RTK "$env:LocalAppData\Packages\RealtekSemiconductorCorp.RealtekAudioControl_dt26b99r8h8gj\Settings\settings.dat"
Write-Host "`nImporting reg..."
# factor in "" marks by not adding them.
reg import $location
Write-Host "`nUnloading hive..."
reg unload HKU\RTK
Write-Host "`nDone!"
start-sleep 3
}
Q {
Exit
}
default {
$errout = 'Invalid option entered!'
}
}
}
until ($Menu -eq 'q')
}
Menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment