Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\*' -Name StateFlags0001 -ErrorAction Silentl圜ontinue | Remove-ItemProperty -Name StateFlags0001 -ErrorAction Silentl圜ontinue Write-Host 'Clearing CleanMgr.exe automation settings.' However, at some point CleanMgr spawns new processes which are visible and must be waited on separately. You will find the Registry key names in the "VolumeCaches" branch.Īs far as being silent, this script attempts to start CleanMgr.exe in a hidden window. To automate other extensions, create a "StateFlags0001" property in the corresponding Registry key, as done in the New-ItemProperty lines. In this case, it removes temporary files and runs the Update Cleanup extension to purge superseded Service Pack Backup files (Windows 10 now does this automatically via a scheduled task). The following Powershell script automates CleanMgr.exe.
0 Comments
Leave a Reply. |