Enhance Your Control: How to Remove an Application from Add or Remove Programs

adrian
adrian Internal Posts: 3
edited December 2023 in Scripts

Since the first part seems to be useful, I've decided to contribute more :D

Ever wished to discreetly uninstall an application without leaving a trace in the familiar "Add or Remove Programs" (appwiz.cpl) window? This post unveils a clever trick to remove an application from the list without affecting its functionality. This is perfect for situations where you want to manage applications more discreetly or temporarily hide certain entries.

Benefits:

  • Discreetly remove applications from the "Add or Remove Programs" list.
  • Maintain control over which applications are visible to users.
  • Ideal for scenarios where you need to manage installed applications without uninstalling them permanently.

How it Works: We'll use a PowerShell script to modify the registry and set the SystemComponent key to 1. This change will hide the application from the "Add or Remove Programs" list.

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) {
New-ItemProperty -Path $InstallerKey -Name 'SystemComponent' -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
}
}

Disclaimer: Always remember to test scripts in a safe environment before deploying them system-wide. Changes to the registry can have significant impacts, and thorough testing is essential to avoid unintended consequences.

Comments