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
- 41 Getting started
- 25 Read before posting
- 8 Meet and greet
- 237 General
- 64 News and announcements
- 1 Swag
- 1 Roadmap updates
- 79 Resources
- 12 Knowledge Base
- 16 Webinars
- 1 Shared Script Library
- 2 Blog
- 19 Pro Tips
- 27 Got an idea?
- 3 Atera Academy
- 2 ActionAI
- 1 Copilot
- 140 Remote Monitoring and Management
- 84 Remote Monitoring
- 27 Patch Management
- 105 Professional Services Automation
- 64 Helpdesk
- 17 Billing
- 21 Reporting
- 36 Integrations & add-ons
- 20 Integrations
- 10 Add-ons
- 103 Scripting and automations
- 61 Scripts
- 30 Automations