Last active
January 25, 2023 20:56
-
-
Save foontzoot/0bfcb871f98cc3f5f7f0167c66fa27cb to your computer and use it in GitHub Desktop.
Block Razer Synapse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To run this PowerShell script directly from your terminal, please use: