Skip to content

Instantly share code, notes, and snippets.

@nopeless
Last active March 24, 2024 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nopeless/2621be04771318fa9ebb8994c245d0e8 to your computer and use it in GitHub Desktop.
Save nopeless/2621be04771318fa9ebb8994c245d0e8 to your computer and use it in GitHub Desktop.
uninstall razer script because the uninstaller doesn't properly uninstall
Set-PSDebug -Strict
Set-StrictMode -Version Latest
$WarningPreference = "Inquire"
$ErrorActionPreference = "Stop"
$rp = Get-Process | ? { $_ -like "*razer*" }
if ($rp -and $rp.Count -gt 0) {
Write-Host "Potential Razer processes:"
foreach ($p in $rp) {
Write-Host $p
}
Write-Warning "Some razer processes seem to be running`nContinue if they aren't razer processes. Otherwise, stop these processes first then exit and restart this script"
}
foreach ($path in @(
"$env:ProgramData\Razer",
"$env:ProgramFiles\Razer",
"${env:ProgramFiles(x86)}\Razer",
"$env:LOCALAPPDATA\Razer",
"$env:LOCALAPPDATA\Razer Chroma SDK",
"$env:TMP\Razer",
"$env:TMP\Razer Chroma SDK",
"C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\Razer Inc",
"C:\Windows\Installer\Razer",
"C:\Windows\Installer\RazerSynapse",
"$([Environment]::GetFolderPath('StartMenu'))\Programs\Razer",
"$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Razer"
)) {
Write-Host "Testing: $path"
if (Test-Path -LiteralPath $path) {
Remove-Item -Recurse -Force -LiteralPath $path
Write-Host "Removed"
}
}
$ss = Get-Service -ErrorAction SilentlyContinue | ? { $_ -Like "*razer*" }
foreach ($s in $ss) {
Write-Host "Testing service: $s"
Remove-Service $s -Confirm
}
foreach ($reg in @(
"HKLM:\SOFTWARE\RAZERWUD"
)) {
Write-Host "Testing: $reg"
if (Test-Path -LiteralPath $reg) {
Remove-Item -Force -Recurse -LiteralPath $reg
Write-Host "Removed"
}
}
foreach ($reg in (Get-ChildItem -LiteralPath "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Tracing" | ? { $_ -like "*razer*" } | % { $_.PSChildName })) {
$p = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Tracing\$reg"
Remove-Item -Recurse -Force -LiteralPath $p
Write-Host "Removed $p"
}
Write-Host "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment