Nanfeng

Notes on software development, code, and curious ideas

Safely Freeing Disk Space on Windows

The Windows system drive can gradually lose free space as temporary files, update caches, recycle-bin contents, and application data accumulate.

The original article proposed a batch file that recursively deleted every .tmp, .log, .old, and several other file types across the entire system drive. That approach is too broad: those extensions may contain active application data, diagnostic records, or files required for recovery. A safer process is to use Windows’ built-in cleanup controls.

Temporary files

  1. Open Settings → System → Storage.
  2. Select Temporary files.
  3. Review every category. In particular, verify Downloads before selecting it.
  4. Choose only the categories you understand, then click Remove files.

Storage Sense

Under Settings → System → Storage, enable Storage Sense and configure when Windows may remove temporary files or old recycle-bin items. Keep automatic deletion of Downloads disabled unless that behavior is intentional.

Disk Cleanup

Search for Disk Cleanup, choose the system drive, and review the proposed categories. The Clean up system files option can remove obsolete Windows Update files, but create a backup or restore point first if rollback capability matters.

Also uninstall unused applications through Settings → Apps, move personal media to another drive, and use the Storage page to identify the largest categories. Avoid third-party “registry cleaners” and scripts that recursively delete files from the Windows or system-drive root.

+