Detect and Remove CCleaner in Powershell
Detect and Remove CCleaner in Powershell
This is a neat little trick to detect CCleaner on a Windows operating system with powershell, then silently uninstall it using powershell.
Code Below:
------------------------------------------Copy----------------------------------------------------
Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object DisplayName -eq CCleaner
----------------------------------------COPY----------------------------------------------
if (Get-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
Where-Object DisplayName -eq CCleaner -OutVariable Results) {
& "$($Results.InstallLocation)\uninst.exe" /S
}
--------------------------------------Copy-----------------------------------------
Creation by Mike Frobbins
http://mikefrobbins.com/2017/09/18/detect-the-presence-of-and-remove-ccleaner-with-powershell/
Join our forum
http://www.briteccomputers.co.uk/forum