Error in "Windows Disk Cleanup" procedure

Hi, I often get an error alert from the “Windows Disk Cleanup” procedure that is performed automatically every week in my clients’ profile. The error is as follows. Is there any way to modify the script to remedy it? Thanks

Data: Traceback (most recent call last): File “”, line 176, in File “”, line 69, in clear_folders WindowsError: [Error 5] Access denied: ‘C:\WINDOWS\SoftwareDistribution\Download\\6e39802cd78b818f64249f0f4cf16e38\Metadadata\SSU-19041. 3505-x64-express\amd64_deployment-7cf2c9b9…6dd84ce56f9dcbc2c4b_31bf3856ad364e35_10.0.19041.3505_none_ef73f6cf0ec4901d.manifest’

Translated with DeepL Translate: The world's most accurate translator (free version)

Sounds like the file is still in use or the user level used to run the procedure does not have permissions to delete the file.

You can right-click on the application file and select “Run as administrator” when installing or running the script. And open the properties of the main User Profile folder where the files are located . Go to the Security tab, click Advanced, and check the box labeled “Replace all child object permissions with inheritable permissions from this object.” Click OK.