Skip to content

Instantly share code, notes, and snippets.

@foontzoot
Last active January 25, 2023 20:56
Show Gist options
  • Save foontzoot/0bfcb871f98cc3f5f7f0167c66fa27cb to your computer and use it in GitHub Desktop.
Save foontzoot/0bfcb871f98cc3f5f7f0167c66fa27cb to your computer and use it in GitHub Desktop.
Block Razer Synapse
$RazerSynapsePath = "C:\Windows\Installer\RazerSynapse"
# Disable driver auto-install via registry
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Installer" -Name "DisableCoInstallers" -Type DWord -Value 1
# Remove and lock install directory
Remove-Item $RazerSynapsePath -Recurse -Force
New-Item -Path "C:\Windows\Installer\" -Name "RazerSynapse" -ItemType "directory"
$Acl = Get-Acl $RazerSynapsePath
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "Write", "ContainerInherit,ObjectInherit", "None", "Deny")
$Acl.SetAccessRule($Ar)
Set-Acl $RazerSynapsePath $Acl
@foontzoot
Copy link
Author

foontzoot commented Jan 25, 2023

To run this PowerShell script directly from your terminal, please use:

irm https://gist.githubusercontent.com/foontzoot/0bfcb871f98cc3f5f7f0167c66fa27cb/raw/94c51a820988fb5d78aeb5cfbbb5c1fb9d04a968/block-razer-synapse.ps1 | iex

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