It is safe to delete the Software Distribution folder.The Software Distribution folder, which temporarily stores files needed to install new updates. It's safe to clear the content of the said folder because Windows will always re-download and re-created all the necessary file and components, if removed.
What will happen if I delete software distribution folder when a cumulative or any other update is being installed or waiting for a restart?
I want to run the below steps in PS script remotely in some devices that have very low disk space:
First,
Stop the windows update service [ net stop wuauserv ] and the Background Intelligent Transfer Service [ net stop bits ]
Second,
Delete all contents of Software Distribution Folder to free some space since the concerned device only has 10GB C:\ drive free space
Third,
Start the windows update service [ net start wuauserv ] and the Background Intelligent Transfer Service [ net start bits ]
Fourth,
Run this command in cmd:
Dism.exe /online /Cleanup-Image /StartComponentCleanup
What will happen when I perform these steps when windows update is in the middle of installing a cumulative or some other updates or when it is waiting for a restart in windows 11 and windows 10?
If this will cause a problem, is there a way to detect if any updates are being installed or a update restart is pending in PowerShell?