Any operating system gets cluttered with temporary files left out from updates, software installation and removal and software operations. In addition to that, Microsoft Windows filesystems (FAT, FAT32, NTFS) historically suffer from file fragmentation issues.
An automated maintenance of the operating system is highly recommended. It frees the user from the burden of manually taking care of the system health, it keeps the system in good shape to help support user productivity activities and postpones eventual feared operating system refreshes.
This article strives to provide a free, lean and simple way of automating Microsoft Windows operating system maintenance. The following topics will be addressed: system and user software temporary files cleanup and disk defragmentation.
Microsoft Windows has come a long way at providing powerful and automated ways for taking care of temporary system files.
Windows 10 introduced the “Storage Sense” solution which is aimed at providing a comprehensive and automated way of managing temporary files and superseeds the previous Disk Cleanup utility (now deprecated). This solution is publicized as a “superset of what the legacy Disk Cleanup provides” but it fails to provide a command line interface and a meaningful cleaning schedule. The clean schedule can be set, but it autonomously decides whether to clean or not at that given time based on hard drive free space and the amount of files to clean.
Luckily for us Disk Cleanup utility is still provided even though deprecated. While waiting for a more “sensible” Storage Sense solution, Disk Cleanup powerful utility can be set to clean temporary system files in an automated way following a schedule.
cleanmgr /sageset:0
and from the “Disk Cleanup” tab select any file category you want to clean on schedule (personally I only leave out “Downloads” and “Recycle Bin” as I manually prefer to check them). To save the clean preferences click “OK”. The command cleanmgr /sageset:n
let define “Disk Cleanup” cleaning presets that can be run, without further user interaction, with the twin command cleanmgr /sagerun:n
. A massive total of 65536 different cleanup profiles can be defined by appropriately setting the n
option parameter in the range 0
to 65535
./sagerun:0
Several tools for cleaning temporary files on Microsoft Windows exist, such as the famous CCleaner.
A great, fully free and opensource alternative exists in BleachBit. A great advantage of BleachBit over its freeware counterpart is the always up-to-date community curated list of “cleaners” (cleaning configurations) for a large number of software.
C:\Program Files (x86)\BleachBit\bleachbit_console.exe
(this is the installation folder of BleachBit) and “Add arguments (optional)” to --no-uac --preset --clean --update-winapp2
Several tools for defragmenting files on Microsoft Windows exist, such as the built-in one Windows Defragmenter.
A great, free and powerful alternative is Defraggler. Defraggler over its built-in counterpart is more featured and customizable. It has great visualization tools over benchmarks and the state of fragmentation of the drive, it allows to setup boot time and single folders defragmentations.
The description of a “set and forget” schedule to maintain the responsiveness of a Microsoft Windows operating system has been explained.
Main tools and software for Windows maintenance, and the Windows Scheduler have been described in the most essential parts with a focus on the features needed for this article. The first schedule run will likely take some time and resources, but after it will become just part of the operating system routines, like software updates.
This article proposes a starting point, and an essential way on defining a basic maintenance routine for the Windows operating system which can be customized as liked.