Skip to Content

How to fix Windows Server 2019 bug Disk Cleanup / SilentCleanup Deletes Temp Folders?

Microsoft Japan Windows Technology Support published a problem that temporary folders referenced by environment variable %TEMP% or %TMP% are deleted by Disk Cleanup task (SilentCleanup mode) under certain circumstances. This problem is affecting Windows Server 2019.

This bug caused temporary folders get deleted instead of just emptying it. If the folders of the environment variables %TEMP% and %TMP% are deleted, various applications related to the temporary area won’t work.

Solution 1: Re-login Windows again

The folders that %TEMP% and %TMP% environment variables point to are created at login. A new login solves the issue.

Solution 2: Disable Disk Cleanup in Task Scheduling

  1. Start command prompt (CMD) in Administrator mode.
  2. Run following command:
    schtasks / change / tn \ Microsoft \ Windows \ DiskCleanup \ SilentCleanup / disable

Disable SilentCleanup task in Windows Server 2019