Skip to main content

Worklet: Uninstall CCleaner on Windows

  • March 17, 2021
  • 0 replies
  • 88 views

Hi all, sharing another worklet we used to uninstall CCleaner, not a common everyday application but might be useful to some.

Evaluation:

if (Test-Path -Path "C:\Program Files\CCleaner") 
{
	Write-Output "CCleaner not installed, skipping" 
	exit 0
} 
else 
{ 
	Write-Output "CCleaner installed, we will remove" 
	Exit 1 
}

Remediation:

Write-Output "CCleaner installed, now removing" 
Start-Process -FilePath "c:\program files\ccleaner\uninst.exe" -ArgumentList "/S" -WindowStyle Hidden