Skip to content

Instantly share code, notes, and snippets.

@vanzan01
Last active May 15, 2025 05:37
Show Gist options
  • Save vanzan01/20433479d6792e2edf5758ecbeee2065 to your computer and use it in GitHub Desktop.
Save vanzan01/20433479d6792e2edf5758ecbeee2065 to your computer and use it in GitHub Desktop.
Fixing Razer Game Manager logoff crashes on Windows 11 24H2 shutdown
# Fix-Razer.ps1 – grace first, force only if needed
$displayName = 'Razer Game Manager Service 3'
$exeName = 'GameManagerService3'
# --- 1 try a normal Stop-Service (graceful) -------------------------------
try {
$svc = Get-Service -DisplayName $displayName -ErrorAction Stop
if ($svc.Status -ne 'Stopped') {
Write-Verbose "Sending SERVICE_CONTROL_STOP to $displayName"
Stop-Service -Name $svc.Name -ErrorAction Stop -WarningAction SilentlyContinue
$svc.WaitForStatus('Stopped','00:00:05') # wait up to 5 s
}
} catch {
Write-Verbose "Graceful stop failed or timed-out: $_"
}
# --- 2 ensure the exe is really gone --------------------------------------
Get-Process -Name $exeName -ErrorAction SilentlyContinue |
Stop-Process -Force -ErrorAction SilentlyContinue
@vanzan01
Copy link
Author

vanzan01 commented Apr 27, 2025

# Fixing Razer Game Manager crashes on Windows 11 24H2 shutdown  
### …with one PowerShell shutdown script

---

## ⚠️ The problem

**Process:** `GameManagerService3.exe` (Razer Game Manager Service 3)  
**OS:** Windows 11 24H2 (OS Build 26100.3775)  
**Symptom:** Every shut-down logs  
  `Application Error 1000 | KERNELBASE.dll | 0xe0434352`  
  in Event Viewer / Reliability Monitor.

---

## 🎯 The goal  

Stop the service **gracefully** during Windows shutdown and
kill it only if it ignores the STOP request—no crashes, no 7034 warnings.

---

## 🛠️ The one-file script

Save as  

C:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown\Fix-Razer.ps1


```powershell
# Fix-Razer.ps1 — grace first, force if needed
$svcName = 'Razer Game Manager Service 3'
$exe     = 'GameManagerService3'

try {
    $svc = Get-Service -DisplayName $svcName -ErrorAction Stop
    if ($svc.Status -ne 'Stopped') {
        Stop-Service -Name $svc.Name -ErrorAction SilentlyContinue
        $svc.WaitForStatus('Stopped', '00:00:05')   # ⬅ 5-s grace window
    }
} catch {}

Get-Process -Name $exe -ErrorAction SilentlyContinue |
    Stop-Process -Force -ErrorAction SilentlyContinue

📑 Wire it into shutdown (Local GPO)

  1. gpedit.msc
  2. Computer Config → Windows Settings → Scripts (Startup/Shutdown)
  3. Shutdown ▶ PowerShell Scripts tab ▶ Add…
    select Fix-Razer.ps1 (folder opens automatically).
  4. Leave Parameters blank, click OK.
  5. Disable Fast Startup (so shutdown scripts always run):
    powercfg -h off

✅ What happens on shutdown

  1. Windows logs Event 6006 (Event Log service stopping).
  2. Fix-Razer.ps1 runs first.
  3. Sends Stop-Service and waits 5 s.
  4. If the service won’t comply, Stop-Process -Force kills GameManagerService3.exe.
  5. Result: no Application Error 1000 and no 7034 “terminated unexpectedly”.

🔎 Verifying

  • Event Viewer → GroupPolicy/Operational → ID 4098
    shows Completed successfully (0x0).
  • Event Viewer → Application has no new KERNELBASE crash.
  • Reliability Monitor: red “X” for the service stops appearing.

📝 Notes

  • Works on Synapse 4 (yes its still a problem!).
  • Increase or decrease the WaitForStatus timeout if you want a longer or shorter grace period.
  • Keep Fast Startup disabled; hybrid shutdown skips GPO shutdown scripts.

Happy (clean) shutdowns! 🚀

@pa-0
Copy link

pa-0 commented May 15, 2025

Thanks for sharing this write-up. I took the notes in your comments and added them into a README.md that I made part of the gist. That way if someone clones or forks it, they get your notes along with the script. (Comments don't travel with gists).

@vanzan01
Copy link
Author

thanks bro - hope your crashes are solved!

@pa-0
Copy link

pa-0 commented May 15, 2025

thanks, man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment