Kaseya Script for Windows Disk Cleanup
Aren’t you glad you stumbled upon this Kaseya Script for Windows Disk Cleanup? This Windows Disk Cleanup script for Kaseya cleans up everything from windows.
What does it do?
I am glad you asked. The script uses the Kaseya scripting engine to apply the options below to the registry and afterwards the script will run a CMD to run the specific Disk Cleaner Settings Profile we created to clean up all the junk.
- Active Setup Temp Folders
- BranchCache
- Downloaded Program Files
- GameNewsFiles
- GameStatisticsFiles
- GameUpdateFiles
- Internet Cache Files
- Memory Dump Files
- Offline Pages Files
- Old ChkDsk Files
- Previous Installations
- Recycle Bin
- Service Pack Cleanup
- Setup Log Files
- System error memory dump files
- System error minidump files
- Temporary Files
- Temporary Setup Files
- Temporary Sync Files
- Thumbnail Cache
- Update Cleanup
- Upgrade Discarded Files
- User file versions
- Windows Defender
- Windows Error Reporting Archive Files
- Windows Error Reporting Queue Files
- Windows Error Reporting System Archive Files
- Windows Error Reporting System Queue Files
- Windows ESD installation files
- Windows Upgrade Log Files
So there is a downside unfortunately this script only works when the user is logged in and it cannot be ran as silent. To automatically deploy this script on a scheduled basis, within Kaseya we used Policy Management and configured a new Scheduled policy to run this Windows Disk Cleanup Kaseya script every evening while users are logged in.
Below you can see the Kaseya Script. I also provided the download link for it.
<?xml version="1.0" encoding="utf-8"?> <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting"> <Procedure name="Windows Disk Cleaner" treePres="3" id="1946074875" folderId="113237001566792" treeFullPath="myProcedures - [email protected]"> <Body description=""> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="Integer" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active Setup Temp Folders\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="Integer" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded Program Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameStatisticsFiles\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameStatisticsFiles\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameUpdateFiles\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameUpdateFiles\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Internet Cache Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Memory Dump Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Offline Pages Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Old ChkDsk Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Service Pack Cleanup\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Service Pack Cleanup\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files/StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Setup Log Files/StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error memory dump files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\System error minidump files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Sync Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Sync Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Upgrade Discarded Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Upgrade Discarded Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions\StateFlags0100 " /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\User file versions\StateFlags0100 " /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Defender\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Archive Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Archive Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Queue Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting Queue Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Archive Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Archive Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Queue Files\StateFlags0100 " /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Error Reporting System Queue Files\StateFlags0100 " /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows ESD installation files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows ESD installation files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Upgrade Log Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="SetRegistryValue64" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Windows Upgrade Log Files\StateFlags0100" /> <Parameter xsi:type="StringParameter" name="Value" value="2" /> <Parameter xsi:type="EnumParameter" name="DataType" value="String" /> </Statement> <Statement name="ExecuteShellCommand" continueOnFail="false"> <Parameter xsi:type="StringParameter" name="Command" value="%SystemRoot%\SYSTEM32\cleanmgr.exe /s /q START /WAIT cleanmgr /sagerun:100" /> <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" /> <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" /> </Statement> <Statement name="WriteScriptLogEntry" continueOnFail="false" osType="Windows"> <Parameter xsi:type="StringParameter" name="Comment" value="Windows Disk Cleanup Complete." /> </Statement> </Body> </Procedure> </ScriptExport>
Kasey Script Procedure for Windows Disk Cleanup
- Automating System Updates with Unattended-Upgrades on Ubuntu
- How to Add a Large Disk Partition as Storage in Proxmox VE
- How to Remove Radmin Viewer with PowerShell
- How to Automate Ubuntu Server System Updates and Package Installation
- Introducing Zevonix: Your Pathway to Smarter IT
Discover more from Patrick Domingues
Subscribe to get the latest posts sent to your email.