Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand

Downloads:

1,023,510

Downloads of v 0.0.4:

676

Last Update:

10 Jun 2018

Package Maintainer(s):

Software Author(s):

  • bcurran3

Tags:

bcurran3 unofficial choco cleaner cleanup schtasks scheduled task

(unofficial) Choco Cleaner (Script + Task)

This is not the latest version of (unofficial) Choco Cleaner (Script + Task) available.

  • 1
  • 2
  • 3

0.0.4 | Updated: 10 Jun 2018

Downloads:

1,023,510

Downloads of v 0.0.4:

676

Maintainer(s):

Software Author(s):

  • bcurran3

(unofficial) Choco Cleaner (Script + Task) 0.0.4

This is not the latest version of (unofficial) Choco Cleaner (Script + Task) available.

  • 1
  • 2
  • 3

All Checks are Passing

3 Passing Tests


Validation Testing Passed


Verification Testing Passed

Details

Scan Testing Successful:

No detections found in any package files

Details
Learn More

Deployment Method: Individual Install, Upgrade, & Uninstall

To install (unofficial) Choco Cleaner (Script + Task), run the following command from the command line or from PowerShell:

>

To upgrade (unofficial) Choco Cleaner (Script + Task), run the following command from the command line or from PowerShell:

>

To uninstall (unofficial) Choco Cleaner (Script + Task), run the following command from the command line or from PowerShell:

>

Deployment Method:

NOTE

This applies to both open source and commercial editions of Chocolatey.

1. Enter Your Internal Repository Url

(this should look similar to https://community.chocolatey.org/api/v2/)


2. Setup Your Environment

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

2. Get the package into your environment

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Copy Your Script

choco upgrade choco-cleaner -y --source="'INTERNAL REPO URL'" --version="'0.0.4'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade choco-cleaner -y --source="'INTERNAL REPO URL'" --version="'0.0.4'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Install choco-cleaner
  win_chocolatey:
    name: choco-cleaner
    version: '0.0.4'
    source: INTERNAL REPO URL
    state: present

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.


chocolatey_package 'choco-cleaner' do
  action    :install
  source   'INTERNAL REPO URL'
  version  '0.0.4'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


cChocoPackageInstaller choco-cleaner
{
    Name     = "choco-cleaner"
    Version  = "0.0.4"
    Source   = "INTERNAL REPO URL"
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'choco-cleaner':
  ensure   => '0.0.4',
  provider => 'chocolatey',
  source   => 'INTERNAL REPO URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


4. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

Package Approved

This package was approved as a trusted package on 17 Jun 2018.

Description

DO YOU WANT TO RECOVER SOME DISK SPACE USED BY UNNECESSARY RESIDUAL CHOCOLATEY FILES?

YOU JUST FOUND THE EASY WAY!

This package creates a Windows Scheduled Task to run choco-cleaner.ps1 every Sunday at 11:00 PM.

BEFORE and AFTER choco-cleaner: (198 packages installed and does not include temp folder deletions.)

schreenshot of files and diskspace  before choco-cleaner schreenshot of files and diskspace after choco-cleaner

Sure, you're probably not going to get gigabytes of space back, but every few KB matters on some computers and to some people! Due to slack space small files such as 6 byte .ignore files actually take up 4 KB of HDD space each.

FEATURES:

Set it and forget it! choco-cleaner cleans up your Chocolatey installation every Sunday at 11 PM in the background so you don't have to be bothered with it.

choco-cleaner is completely configurable, just edit \ProgramData\chocolatey\bin\choco-cleaner.xml and set true/false for any grouping of file types you want to delete or not. License and log files default to false. This has been mandated to me for passing moderation. Everything else listed below is deleted by default.

choco-cleaner deletes:

  • .log files that are not the most current one (NOT default)
  • .zip, .rar, .iso, and various archive files left over from packages that forgot to delete them post install
  • .zip.txt and other archive-extensions.txt are lists of files that were extracted from an archive file for installation
  • .msi, .msu, and .msp are Microsoft intall packages left over from packages that forgot to delete them post install
  • .ignore files that are created to not shim executables during package install but not needed after shim operations are finished (This may change in a future version of Chocolatey.)
  • credits.txt are program credits (of contributors) files you can read on the web
  • readme.txt files you can read on the web
  • .md files are usually markdown readme files that you can read on the web
  • .old files are Chocolatey files that have been replaced by newer versions (exe's and dll's mostly)
  • chocolatey.config.backup is a backup of your chocolatey.config file
  • _processed.txt - I have no idea what made this file or why it exists
  • lib-bad holds packages that failed to install and lib-bkp contains aborted packages (during updates?)
  • archives and executables out of .nuspkg files which are ZIP archives with NuGet package information - this is similar to what Package Reducer does
  • \users\username\AppData\Local\Temp\chocolatey is where new package files are downloaded to during pre-installation (if you haven't changed your cacheLocation in chocolatey.config))
  • \users\username\AppData\Local\Nuget\Cache if Nuget client is installed and caching files there
  • \Windows\Temp\chocolatey
  • license.txt and verification.txt files are included when packages include binaries, you can read them on the package web page, programname.license.txt files are license files for Chocolatey default tools (NOT default)

INSTRUCTIONS:

To manually run choco-cleaner:

  • Command Prompt: \ProgramData\chocolatey\lib\choco-cleaner\tools\choco-cleaner-manual.bat
  • PowerShell: \ProgramData\chocolatey\bin\choco-cleaner.ps1
  • Windows Start Menu: click the icon. If you have choco-shortcuts-winconfig installed you'll find it with the rest of the Chocolatey Shortcuts.

PACKAGE NOTES


tools\.SkipAutoUninstaller
 
tools\choco-cleaner-manual.bat
@echo off
net session >nul 2>&1
if %errorLevel% == 0 goto RunScript
  else (
   color 4e
   cls
   echo.
   echo                  ********************************************
   echo                  *  You must choose "Run as administrator"  *
   echo                  ********************************************
   echo.
   timeout 5
   goto end
 )

:RunScript
powershell -NoProfile -ExecutionPolicy Bypass -Command "%ChocolateyInstall%\bin\choco-cleaner.ps1"
:end

tools\choco-cleaner.ps1
# choco-cleaner.ps1 by Bill Curran 
# LICENSE: GNU GPL v3 - https://www.gnu.org/licenses/gpl.html
# Open a GitHub issue if you have a suggestion/request.
$CCver = "v0.0.4 (06/10/2018)"
$xml   = 'choco-cleaner.xml'

Write-Host "choco-cleaner.ps1 $CCver - deletes unnecessary residual Chocolatey files to free up disk space" -foreground white
Write-Host "Copyleft 2017-2018 Bill Curran ([email protected]) - free for personal and commercial use" -foreground white

# Import preferences - see choco-cleaner.xml
[xml]$ConfigFile = Get-Content "$env:ChocolateyInstall\bin\$xml"

$DeleteLogs = $ConfigFile.Settings.Preferences.DeleteLogs
$DeleteArchives = $ConfigFile.Settings.Preferences.DeleteArchives
$DeleteFileLogs = $ConfigFile.Settings.Preferences.DeleteFileLogs
$DeleteMSInstallers = $ConfigFile.Settings.Preferences.DeleteMSInstallers
$DeleteIgnoreFiles = $ConfigFile.Settings.Preferences.DeleteIgnoreFiles 
$DeleteReadmes = $ConfigFile.Settings.Preferences.DeleteReadmes
$DeleteOldChoco = $ConfigFile.Settings.Preferences.DeleteOldChoco 
$DeleteConfigBackupFile = $ConfigFile.Settings.Preferences.DeleteConfigBackupFile
$DeleteLibBad = $ConfigFile.Settings.Preferences.DeleteLibBad
$DeleteLibBkp = $ConfigFile.Settings.Preferences.DeleteLibBkp
$Optimizenupkg = $ConfigFile.Settings.Preferences.Optimizenupkg
$DeleteCache = $ConfigFile.Settings.Preferences.DeleteCache
$DeleteLicenseFiles = $ConfigFile.Settings.Preferences.DeleteLicenseFiles
# new configuration items since implementation of XML config in v0.0.3
$DeleteNuGetCache = $ConfigFile.Settings.Preferences.DeleteNuGetCache

# Import chocolatey.config (future use)
#[xml]$ChocoConfigFile = Get-Content "$env:ChocolateyInstall\config\chocolatey.config"
#parse <add key="cacheLocation" value="" description="Cache location if not TEMP folder. Replaces `$env:TEMP` value." />
#$cacheLocation = $ConfigFile.config.cacheLocation.value

if ($env:ChocolateyInstall -match $env:SystemDrive -and $env:SystemDrive -eq "C:")
    {
     $FreeBefore = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" | Foreach-Object {$_.FreeSpace}
    }
Write-Host "choco-cleaner Summary:" -foreground magenta
Write-Host " * Deleting unnecessary _processed.txt (WTF?) file..." -foreground magenta
Remove-Item -path $env:chocolateyinstall\bin\_processed.txt -ErrorAction SilentlyContinue

if ($DeleteLogs)
    {
     Write-Host " * Deleting unnecessary log files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\logs\* -recurse -exclude chocolatey.log,choco.summary.log -ErrorAction SilentlyContinue
    }

	if ($DeleteArchives)
    {	
     Write-Host " * Deleting unnecessary archive files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include *.zip,*.rar,*.7z,*.gz,*.tar,*.sfx,*.iso -ErrorAction SilentlyContinue
	}

	if ($DeleteFileLogs)
    {	
     Write-Host " * Deleting unnecessary extracted file logs..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include *.zip.txt,*.exe.txt,*.rar.txt,*.7z.txt,*.gz.txt,*.tar.txt,*.sfx.txt,*.iso.txt -ErrorAction SilentlyContinue
	}

	if ($DeleteMSInstallers)
    {	
     Write-Host " * Deleting unnecessary Microsoft installers..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include *.msi,*.msu,*.msp -ErrorAction SilentlyContinue
	}

	if ($DeleteIgnoreFiles)
    {
     Write-Host " * Deleting unnecessary .ignore files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include *.ignore -ErrorAction SilentlyContinue
	}

	if ($DeleteReadmes)
    {
     Write-Host " * Deleting unnecessary various read me files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include credits.txt,readme.txt,*.md -ErrorAction SilentlyContinue
	}

	if ($DeleteOldChoco)
    {	
     Write-Host " * Deleting unnecessary old Chocolatey files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include *.old -ErrorAction SilentlyContinue
	}

	if ($DeleteConfigBackupFile)
    {	
     Write-Host " * Deleting unnecessary config backup files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\config\chocolatey.config.backup -ErrorAction SilentlyContinue
	}

	if ($DeleteLibBad)
    {
     Write-Host " * Deleting unnecessary lib-bad files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\lib-bad -recurse -ErrorAction SilentlyContinue
	}

	if ($DeleteLibBkp)
    {	
     Write-Host " * Deleting unnecessary lib-bkp files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\lib-bkp -recurse -ErrorAction SilentlyContinue
	}

	if ($DeleteLicenseFiles)
    {
     Write-Host " * Deleting unnecessary license files..." -foreground magenta
     Remove-Item -path $env:chocolateyinstall\* -recurse -include license.txt,*.license.txt,verification.txt -exclude shimgen.license.txt -ErrorAction SilentlyContinue
	}
	
# If cacheLocation in chocolatey.config has NOT been changed (most people)...
# I'm going to change this to read in the location from chocolatey.config in the future
if ($DeleteCache)
    {
     Write-Host " * Deleting unnecessary Chocolatey cache files..." -foreground magenta
     Remove-Item -path $env:tmp\chocolatey -recurse -ErrorAction SilentlyContinue
	 Remove-Item -path $env:SystemRoot\temp\chocolatey -recurse -ErrorAction SilentlyContinue
	}
	
if ($DeleteNuGetCache)
    {
     Write-Host " * Deleting unnecessary Nuget cache files..." -foreground magenta
     Remove-Item -path $env:USERPROFILE\AppData\Local\NuGet\Cache -recurse -ErrorAction SilentlyContinue
	}	
	
if ($Optimizenupkg)
    {	
     Write-Host " * Deleting unnecessary archives and executables in .nupkg files..." -foreground magenta
     dir $env:chocolateyinstall\lib -recurse -include *.nupkg | %{7z d -r -tZIP $_.FullName *.exe *.zip *.rar *.7z *.gz *.tar *.sfx *.iso *.msi *.msu *.msp} | Out-Null
	}	

if ($env:ChocolateyInstall -match $env:SystemDrive -and $env:SystemDrive -eq "C:")
    {
     $FreeAfter = Get-WmiObject Win32_LogicalDisk -Filter "DeviceID='C:'" | Foreach-Object {$_.FreeSpace}
	 $FreedSpace = $FreeAfter - $FreeBefore
     $FreedSpace = $FreedSpace / 1024
	 Write-Host choco-cleaner finished deleting unnecessary Chocolatey files and saved you $freedspace.ToString('N0') KB! -foreground green
    } else {
	  Write-Host choco-cleaner finished deleting unnecessary Chocolatey files! -foreground green
	 }
Write-Host "Found choco-cleaner.ps1 useful? Consider buying me a beer via PayPal at https://www.paypal.me/bcurran3donations" -ForegroundColor white
Start-Sleep -s 10
tools\choco-cleaner.xml
<?xml version="1.0"?>
<Settings>
  <Preferences>
    <DeleteLicenseFiles>false</DeleteLicenseFiles>  
    <DeleteLogs>false</DeleteLogs>
    <DeleteFileLogs>false</DeleteFileLogs>	
    <DeleteArchives>true</DeleteArchives>
    <DeleteMSInstallers>true</DeleteMSInstallers>
    <DeleteIgnoreFiles>true</DeleteIgnoreFiles>
    <DeleteReadmes>true</DeleteReadmes>
    <DeleteOldChoco>true</DeleteOldChoco>
    <DeleteConfigBackupFile>true</DeleteConfigBackupFile>
    <DeleteLibBad>true</DeleteLibBad>
    <DeleteLibBkp>true</DeleteLibBkp>
    <Optimizenupkg>true</Optimizenupkg>
    <DeleteCache>true</DeleteCache>
	<DeleteNuGetCache>true</DeleteNuGetCache>
  </Preferences>
</Settings>

<!--
#######################################################################################################################
# You can comment out anything above that you do not want to delete such as log or license files with a # at the front of the line.
# File deletion statements (Remove-Item) are purposely grouped for easy disabling based on types of files.
# 
# LEGEND:
# * .log files that are not the most current one
# * .zip, .rar, .iso, and various archive files left over from packages that forgot to delete them post install
# * .zip.txt and other archive-extensions.txt are lists of files that were extracted from an archive file for installation
# * .msi, .msu, and .msp are Microsoft intall packages left over from packages that forgot to delete them post install
# * .ignore files are created to not shim executables during package install but not needed after shim operations are finished (This may change in a # future version of Chocolatey.)
# * credits.txt are program credits (of contributors) files you can read on the web
# * readme.txt files you can read on the web
# * .md files are usually markdown readme files that you can read on the web
# * .old files are Chocolatey files that have been replaced by newer versions (exe's and dll's mostly)
# * chocolatey.config.backup is a backup of your chocolatey.config file
# * _processed.txt - I have no idea what made this file
# * lib-bad holds packages that failed to install and lib-bkp contains aborted packages (during updates?) 
# * archives and executables out of .nuspkg files which are ZIP archives with NuGet package information - this is similar to what [Package Reducer](https://chocolatey.org/docs/features-package-reducer) does
# * \Users\username\AppData\Local\Temp\chocolatey is where new package files are downloaded to during pre-installation (if you haven't changed your cacheLocation in chocolatey.config)
# * license.txt and verification.txt files are included when packages include binaries, you can read them on the package web page, programname.license.txt files are license files for Chocolatey default tools
# * NuGet cach is where NuGet stores cached .nupkg files
#######################################################################################################################
-->
tools\ChocolateyInstall.ps1
$packageName      = 'choco-cleaner'
$toolsDir         = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$script           = 'choco-cleaner.ps1'
$xml              = 'choco-cleaner.xml'
$shortcutName     = 'Choco Cleaner.lnk'
$altshortcutName  = 'Chocolatey Cleaner.lnk'
$GotTask          = (&schtasks /query /tn choco-cleaner) 2> $null

Function Update-Config{
[xml]$UpdatedConfig = Get-Content "$env:ChocolateyInstall\bin\$xml"

$DeleteNuGetCache = $UpdatedConfig.Settings.Preferences.DeleteNuGetCache
if ($DeleteNuGetCache -eq $null)
   {
    Write-Host Adding DeleteNuGetCache support to $xml. -foreground magenta
	$NewStuff=$UpdatedConfig.CreateNode("element", "DeleteNuGetCache", $null)
    $NewStuff.InnerText=("true") 
	$UpdatedConfig.Settings.Preferences.AppendChild($NewStuff) | out-null
	$UpdatedFile = "True"
   }
   
if ($UpdatedFile -eq "True")
   {   
    $UpdatedConfig.Save("$env:ChocolateyInstall\bin\$xml")
	Write-Host "Updated $xml" -foreground magenta
   }
}

Move-Item "$toolsDir\$script" $env:ChocolateyInstall\bin -Force -ErrorAction SilentlyContinue

if ($GotTask -ne $null){
   Write-Host
   Write-Host Existing choco-cleaner scheduled task found: -foreground magenta 
   SchTasks /query /tn "choco-cleaner"
   Write-Host Keeping existing scheduled task and upgrading script files. -foreground magenta
   }

if (Test-Path $env:ChocolateyInstall\bin\$xml){
      Write-Host "Existing $xml file found, your preferences have been saved." -foreground magenta
	  Update-Config
      Remove-Item $toolsDir\$xml -Force -ErrorAction SilentlyContinue
    } else {
	  Move-Item "$toolsDir\$xml" $env:ChocolateyInstall\bin -Force -ErrorAction SilentlyContinue
      $WhoAmI=whoami
      $Acl = Get-Acl "$env:ChocolateyInstall\bin\$xml"
      $Ar = New-Object  system.security.accesscontrol.filesystemaccessrule($WhoAmI,"FullControl","Allow")
      $Acl.SetAccessRule($Ar)
      Set-Acl "$env:ChocolateyInstall\bin\$xml" $Acl	  
	}
	
If (Test-Path "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey"){
      Install-ChocolateyShortcut -shortcutFilePath "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey\$shortcutName" -targetPath "$env:SystemRoot\system32\WindowsPowerShell\v1.0\powershell.exe" -Arguments "-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command $env:ChocolateyInstall\bin\$script" -IconLocation $env:ChocolateyInstall\choco.exe -WorkingDirectory $env:ChocolateyInstall\bin\ -RunAsAdmin
    } else {
      Install-ChocolateyShortcut -shortcutFilePath "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$altshortcutName" -targetPath "$env:SystemRoot\system32\WindowsPowerShell\v1.0\powershell.exe" -Arguments "-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command $env:ChocolateyInstall\bin\$script" -IconLocation $env:ChocolateyInstall\choco.exe -WorkingDirectory $env:ChocolateyInstall\bin\ -RunAsAdmin
	}	
if ($GotTask -ne $null){ exit }
SchTasks /Create /SC WEEKLY /D SUN /RU SYSTEM /RL HIGHEST /TN "choco-cleaner" /TR "cmd /c powershell -NoProfile -ExecutionPolicy Bypass -Command %ChocolateyInstall%\bin\choco-cleaner.ps1" /ST 23:00 /F
SchTasks /query /tn "choco-cleaner"
Write-Host "Now configured to run choco-cleaner at 11:00 PM every SUNDAY." -foreground green
Write-Host "TO MANUALLY RUN CHOCO-CLEANER:" -foreground magenta
Write-Host "COMMAND PROMPT: $env:ChocolateyInstall\lib\choco-cleaner\tools\choco-cleaner-manual.bat" -foreground magenta
Write-Host "POWERSHELL: $env:ChocolateyInstall\bin\choco-cleaner.ps1" -foreground magenta
Write-Host "WINDOWS START MENU: click the Chocolatey Cleaner icon. If you have choco-shortcuts-winconfig installed you'll find Choco Cleaner with the rest of the Chocolatey shortcuts." -foreground magenta


tools\ChocolateyUninstall.ps1
$packageName      = 'choco-cleaner'
$script           = 'choco-cleaner.ps1'
$xml              = 'choco-cleaner.xml'
$shortcutName     = 'Choco Cleaner.lnk'
$altshortcutName  = 'Chocolatey Cleaner.lnk'

SchTasks /Delete /TN “choco-cleaner” /F

Remove-Item "$env:ChocolateyInstall\bin\$script" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:ChocolateyInstall\bin\$xml" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$altshortcutName" -Force -ErrorAction SilentlyContinue
Remove-Item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey\$shortcutName" -Force -ErrorAction SilentlyContinue

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Add to Builder Version Downloads Last Updated Status
(unofficial) Choco Cleaner (Script + Task) 1.1.0 24233 Monday, June 12, 2023 Approved
(unofficial) Choco Cleaner (Script + Task) 1.0.0 41285 Wednesday, May 10, 2023 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.9.0 17751 Thursday, May 4, 2023 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.8.4 519574 Friday, May 28, 2021 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.8.3 11641 Tuesday, May 11, 2021 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.8.2 22471 Sunday, March 14, 2021 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.8.1 1818 Sunday, March 14, 2021 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.8 18529 Sunday, January 31, 2021 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.7.2 56140 Monday, April 6, 2020 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.7.1 10989 Thursday, January 16, 2020 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.7 5749 Saturday, December 28, 2019 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.6 427 Tuesday, December 17, 2019 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.5.2 12084 Thursday, January 10, 2019 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.5.1 1559 Tuesday, September 25, 2018 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.5 561 Friday, August 24, 2018 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.4 676 Sunday, June 10, 2018 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.3.1 294 Thursday, June 7, 2018 Approved
(unofficial) Choco Cleaner (Script + Task) 0.0.3 492 Wednesday, May 16, 2018 Approved

If you have a previous release of choco-cleaner installed, upgrading to a new version will NOT modify your current scheduled task or preferences.

11:00 PM was chosen as not to conflict with default installs of choco-upgrade-all-at, choco-persistent-packages, and choco-optimize-at.

Organizations with software license compliance auditing should probably NOT delete the license and verification files for legal protection. The supplied configuration file defaults to false for these types of files. As ferventcode/Rob has said many times, corporations are not advised to use the community repository and should be using Chocolatey for Business with their own internalized local packages.

CHANGELOG:

  • 0.0.4 - added deletion of Nuget Cache folder files
  • 0.0.3.1 - fixed typo causing nupkg files to NOT be optimized - thanks E.R.!
  • 0.0.3 - Rewritten version of 0.0.1 with XML configuration file and ferventcoder/Rob's approved default settings. Minor improvements.
  • 0.0.2 - Unreleased version with two scripts with different default settings; "Bill's way" and "Rob's way" and a package parameter to choose which one to use/install. Shelved.
  • 0.0.1 - Initial release. Did not pass Chocolatey moderation due to mandated changes of default parameters. Only "secretly" available.
Discussion for the (unofficial) Choco Cleaner (Script + Task) Package

Ground Rules:

  • This discussion is only about (unofficial) Choco Cleaner (Script + Task) and the (unofficial) Choco Cleaner (Script + Task) package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or (unofficial) Choco Cleaner (Script + Task), or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus