Automate Disk Cleanup using Task Scheduler in Windows

Type cleanmgr /d c: /sageset:100 in the RUN box. The Disk Cleanup dialog box appears. Check the items you want to clean every time you run this process, for example Recycle Bin, Temporary Internet Files, Old Chkdsk files and then click on OK.

Create a new shortcut in your Windows folder using cleanmgr /sagerun:100 as the command line. Name it as CleanupTask.

Each of the Sageset configurations are stored in the following registry key and sub-keys:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \VolumeCaches