Reply To: Delete' Windows.old' folder using powershell

  • Topaz George

    Organizer
    21 July 2020 at 8:21 pm

    Hope this helps.

    If(Test-Path -Path($((Get-WmiObject Win32_OperatingSystem).SystemDrive) +"\windows.old"))
    { 
    	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations" -Name "StateFlags1221" -PropertyType DWORD  -Value 2 -Force | Out-Null 
    	cleanmgr /SAGERUN:1221 
    }
    

DCOM hardening issue.

This application fails to authenticate with WMI on the SCCM server because Microsoft has not yet hardened DCOM on their Windows Preinstallation Environment. We are working on a different approach, but it will only be released during the first quarter of 2024. But until that time, the only workaround will be to uninstall the update corresponding to KB5004442.