Skip to content

Instantly share code, notes, and snippets.

@foontzoot
Created January 25, 2023 20:38
Show Gist options
  • Save foontzoot/51d4dc604f48dae0f706f3718d09eed9 to your computer and use it in GitHub Desktop.
Save foontzoot/51d4dc604f48dae0f706f3718d09eed9 to your computer and use it in GitHub Desktop.
Block Razer bloatware
# 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
@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/51d4dc604f48dae0f706f3718d09eed9/raw/0035ef27363a1e506c37e528294dcf48b0ca071d/block.ps1 | iex

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