Note: Before following the below procedure, if you are running Windows Server 2008/2012 please be sure to install the ‘Desktop Experience’ feature from Server Manager.
1. Run the below from a command prompt or run dialog window. The /sageset command allows you to record required settings for the Disk Cleanup tool to run silently.
Note: The /sageset:1 can actually be any number up to 65535. This is done so you can have multiple saved settings.
2. Once run, the Disk Cleanup tool will show. Tick your required files to be cleaned (or all) and click OK to save.
3. Create a scheduled task in Windows running the below command. This will repeat as scheduled cleaning the same selected files each time it is run. You can create multiple schedules for each setting you have saved by typing the required saved numbers in the /sagerun option (those you have set in step 1).