Created
January 25, 2023 20:38
-
-
Save foontzoot/51d4dc604f48dae0f706f3718d09eed9 to your computer and use it in GitHub Desktop.
Block Razer bloatware
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
# Code from https://github.com/ChrisTitusTech/block-razer | |
$RazerPath = "C:\Windows\Installer\Razer" | |
# 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 $RazerPath -Recurse -Force | |
New-Item -Path "C:\Windows\Installer\" -Name "Razer" -ItemType "directory" | |
$Acl = Get-Acl $RazerPath | |
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "Write", "ContainerInherit,ObjectInherit", "None", "Deny") | |
$Acl.SetAccessRule($Ar) | |
Set-Acl $RazerPath $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: