Enhance Your Control: How to Hide Uninstall/Change/Repair Buttons in Windows Programs
Are you tired of accidentally uninstalling or modifying critical programs? Want more control over what users can do with your installed applications? In this post, we'll explore a neat trick to hide the Uninstall/Change/Repair buttons from both the traditional "Add or Remove Programs" (appwiz.cpl) and the new "Apps & Features" modal in Windows. This simple tweak provides an extra layer of protection against unintentional modifications.
Benefits:
- Reduce the risk of accidental uninstallations or modifications.
- Enhance security by limiting user interactions with critical applications.
- Customize the user experience by controlling how your installed programs appear in system settings.
How it Works: We'll use a PowerShell script to hide these buttons by modifying the registry entries associated with the installed application.
Before:
After:
Script:
$TargetString = 'Atera'
$RegistryPaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
)
foreach ($RegistryPath in $RegistryPaths) {
$InstallerKey = Get-InstallerKey -RegistryPath $RegistryPath -TargetString $TargetString
if ($InstallerKey) {
'NoRemove', 'NoRepair', 'NoModify' | ForEach-Object {
New-ItemProperty -Path $InstallerKey -Name $_ -Value '1' -PropertyType 'DWord'
}
}
}
function Get-InstallerKey {
param(
[string]$RegistryPath,
[string]$TargetString
)
Get-ChildItem $RegistryPath -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
$CurrentKey = Get-ItemProperty -Path $_.PsPath
if ($CurrentKey -match $TargetString) {
return $CurrentKey.PSPath
}
}
}
Take charge of your installed programs and prevent accidental mishaps. Give it a try and let us know how it works for you! However, always remember to test scripts in a safe environment before deploying them system-wide. The effectiveness of scripts can vary based on system configurations, and unintended consequences may occur if not thoroughly tested.
Comments
-
@adrian Here is to turn it back so you can uninstall if needed!
$TargetString = 'Atera'
$RegistryPaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
)foreach ($RegistryPath in $RegistryPaths) {
$InstallerKey = Get-InstallerKey -RegistryPath $RegistryPath -TargetString $TargetStringif ($InstallerKey) {
'NoRemove', 'NoRepair', 'NoModify' | ForEach-Object {
# Setting the value back to '0' to allow remove, repair, or modify options
Set-ItemProperty -Path $InstallerKey -Name $_ -Value '0'
}
}}
function Get-InstallerKey {
param(
[string]$RegistryPath,
[string]$TargetString
)Get-ChildItem $RegistryPath -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
$CurrentKey = Get-ItemProperty -Path $_.PsPath
if ($CurrentKey -match $TargetString) {
return $CurrentKey.PSPath
}
}}
1 -
@tanderson indeed it works for other apps as well!
Also, thanks for the revert script :D2
Topics
- All Topics
- 42 Getting started
- 26 Read before posting
- 8 Meet and greet
- 257 General
- 71 News and announcements
- 2 Swag
- 1 Roadmap updates
- 83 Resources
- 12 Knowledge Base
- 17 Webinars
- 1 Shared Script Library
- 2 Blog
- 21 Pro Tips
- 28 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 142 Remote Monitoring and Management
- 85 Remote Monitoring
- 28 Patch Management
- 107 Professional Services Automation
- 65 Helpdesk
- 17 Billing
- 22 Reporting
- 41 Integrations & add-ons
- 22 Integrations
- 11 Add-ons
- 108 Scripting and automations
- 62 Scripts
- 32 Automations