Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any defrag tool which defrags every fragmented file at boot time? So far, all of the tools I have seen only defragment the page file, MFT and system files at boot time.

share|improve this question
That's because otherwise booting the system would take far too long. – Ansgar Wiechers Sep 3 '12 at 21:57
Whenever I defragment my HDD, there is always a significant amount fragmentation leftover. I think this is because files are in use during the defragmentation process. – Nyx Sep 3 '12 at 22:00
@Marv wouldn't that make boot times really slow? – Moab Sep 3 '12 at 22:16
@Marv Possible. If you want to do a full defragmentation, you have to stop all non-vital services before running defrag. Defragmentation is somewhat overrated nowadays, though. As long as you have sufficient free disk-space and fragmentation remains below 15-20% your system should be fine. The only thing I'd really keep an eye on are registry and pagefile fragmentation. – Ansgar Wiechers Sep 3 '12 at 22:26
Windows XP and Windows 7 should automatically do this at boot-time, only on Windows 2000 I have used Sysinternals' PageDefrag. – Ansgar Wiechers Sep 3 '12 at 22:49
up vote 3 down vote accepted

I don’t know about defragging utilities with a built-in option to run on boot (Keltari offered one suggestion), but I would strongly recommend against automatically defragging on boot. When Windows boots, there is a lot of disk access as it loads the system, the user profile, the autorun programs, etc. If one of these programs is thrashing the hard-drive to defrag it, the whole system will get bogged down to a horrible degree (unless you are using an SSD in which case you shouldn’t be defragging at all).

A better option is to have an auto-defrag run at a later point after the boot process has finished.

Windows Vista+ added a new startup type to Windows services that allows them to be run automatically, but after Windows has booted. You could create a Windows service that runs the defrag program and set it to Automatic (Delayed).

An even better solution is to use a startup-scheduling program like Startup Delayer (figure 1). With it, you can configure it (and most of your other autorun programs) to automatically run on startup, but in a delayed, staggered manner so that the system doesn’t get bogged down and is responsive immediately. For this, you would want to set it to be the last item (e.g., ~2-3 minute delay) so that it the system has stopped most of its disk access by the time it runs.

Of course you will have to check the help-files of whatever defrag tool you like to see what command-line switches it uses (though usually running the executable with the drive-letter is usually sufficient, e.g., defrag c:).

(If you have a lot of fragments after defragging; then boot into safe-mode (in which programs are not autorun), and perform a regular defrag at that time so that files are not locked.)

As Ansgar suggested, you can configure PageDefrag (figure 2) to defrag the registry hives, page and hibernation files, event logs, etc. during the pre-boot. (It can run in Vista+, but is unnecessary.) You can also use (once every two or three blue moons), NTREGOPT (figure 3) to compact the registry hives (works in Vista+).

With this set of tools, you can keep your system in top condition.

Figure 1: Autorunning Windows’ defrag program:

enter image description here

Figure 2: PageDefrag’s options

enter image description here

Figure 3: NTREGOPT compacting a registry hive

enter image description here

If you must perform an actual defrag at boot, boot-time defragging is an actual selling point of UltimateDefrag.

share|improve this answer

UltraDefrag has boot time defragmentation. I have used it in the past, but not recently. It is free and open-source.

share|improve this answer
-… - Any thoughts? – Alex S Oct 25 '15 at 6:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .