Cleaning SoftwareDistribution folder
Silent install package for Cleaning SoftwareDistribution folder
Package Function Description
This script is designed to reset the Windows Update mechanism on a Windows workstation. Specifically, it performs the following actions:
1 - Stops the Windows Update services (wuauserv), BITS (bits), and Cryptographic Services (cryptsvc)
2 - Completely deletes the C:\Windows\SoftwareDistribution folder in order to clean the update cache and fix potential corruption issues
3 - Restarts the same services so that Windows Update can function normally again and future updates can be detected more easily
4- Finally a DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase is ran
Use Cases
This script is particularly useful in the following situations:
- Repeated Windows Update failures
- Windows Update stuck or returning errors
- Need to start from a clean state for downloading Windows Updates on a workstation
- Windows updates remain in "Pending" status
This script can be automatically deployed via WAPT as part of a one-time corrective action on workstations. It runs immediately after installation; if needed, forcing the package reinstallation will execute it again.
- package: tis-clean-softwaredistribution
- name: Cleaning SoftwareDistribution folder
- version: 1-5
- categories: Security,System and network
- maintainer: WAPT Team,Tranquil IT,Joffrey Le Piquet
- locale: all
- target_os: windows
- architecture: all
- signature_date:
- size: 41.94 Ko
package : tis-clean-softwaredistribution
version : 1-5
architecture : all
section : base
priority : optional
name : Cleaning SoftwareDistribution folder
categories : Security,System and network
maintainer : WAPT Team,Tranquil IT,Joffrey Le Piquet
description :
depends :
conflicts :
maturity : PROD
locale : all
target_os : windows
min_wapt_version : 2.0
sources :
installed_size :
impacted_process :
description_fr :
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor :
keywords :
licence :
homepage :
package_uuid : 199a9629-6b6d-4b58-a8a9-165a13048baf
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum : b3224aa80cc54b54f8732c118ccff5a8968dec827100ff928d919ca0f4bdc8f3
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date : 2026-02-10T12:14:37.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature : bdqeWhiSTIpbuMo3lKIe55MoXmLdGumuCAbfNr1VqOKmmtc5ETYrXK4wyJqyQoKgXyhOeP3EfWFXxcdRXYL/9/fante1nWYf+1FRwrVZCK6lDypcCunpl1YZMjDnYT6P+ytb9WsqEfs8EwJiV0BI5XZkwPTCX5pp7uORRSdI39w7nLSbnpEFCnGhRnr9wxX/mHyqgtdjizOzrT75CDmqqfDzRRJY2X8OAPXVuYiLRd3qeLkL2lC0W7Jp9PavfFUFbFHxL7GrH1DWDVSgJzwRv9AeoCa2HDoPUqWPNgjBq3l94zjFyFdMNvk9gnLPuEonAaPQulMTr1Uz2fpCvCNQmw==
# -*- coding: utf-8 -*-
from setuphelpers import *
def install():
win_services_to_stop = ['wuauserv', 'bits', 'cryptsvc']
software_distrib_windows = makepath(systemdrive, 'windows', 'softwareDistribution')
for s in win_services_to_stop:
if service_is_running(s):
try:
service_stop(s)
except:
pass
if isdir(software_distrib_windows):
# To handle long path create by windows update...
shutil.rmtree('\\\\?\\' + software_distrib_windows)
for s in win_services_to_stop:
if service_is_stopped(s):
try:
service_start(s)
except:
pass
# All existing update packages can't be uninstalled after this command is completed, but this won't block the uninstallation of future update package
run('DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase')
ec3372e983daa50bdd0eca24f999e241cc900c92b46bf0d563d836df79ea4574 : WAPT/README.md
5a75da750e4899c32adb07fdbe6c0a509daad55481230aa243b4f793cfa77ce3 : WAPT/README_fr.md
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
b52ca332218420590812ce61806e11bf0447194590965126fdfef5c631f6f13f : WAPT/control
b3224aa80cc54b54f8732c118ccff5a8968dec827100ff928d919ca0f4bdc8f3 : WAPT/icon.png
cc0dae061b2c366b9f735a2dbcdb642c9a67fee67274c23d13e068409e2950f4 : luti.json
f752b4ab33a9d64befe02e7896240246a70e5619e00d4ee6512129e5014dea3d : setup.py