Can't seem to defrag hard drive under Win XP - SP2. Some error message abt the MS mgmt console comes up instead. Was fine before SP2 installation. Have plenty of free space so that's not the problem. Any ideas?

Kurt :rolleyes:

Dani AI

Generated

Short expert summary and a focused checklist to try before reinstalling SP2.

Since ’s defrag worked again after removing SP2, the most likely causes are a damaged/incorrect Disk Defragmenter MMC console or missing/unregistered Defrag components (snap‑ins and XML parser) rather than free space. If the service tweaks suggested by or the Windows‑Installer change from didn’t fix it, try the targeted repairs below in this order.

  1. Quick checks
  1. Re-register the Defrag snap‑ins and XML parser (elevated command prompt)

    cd /d %windir%\system32
    regsvr32 msxml3.dll
    regsvr32 dfrgsnap.dll
    regsvr32 dfrgui.dll

    Restart and test again. The above sequence is the standard first fix for a broken Defragmenter snap‑in. (See Microsoft Answers and regsvr32 docs.)
    (References: regsvr32 docs — https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/regsvr32 ; Microsoft Answers — link above.)

  2. Reinstall the Defragmenter engine and repair system files

  • Open File Explorer to %windir%\Inf, right‑click dfrg.inf and choose Install to force reinstall of the built‑in defrag components. (This is Microsoft’s KB/FAQ fix for a missing/removed Defragmenter.)
  • If problems persist, run:
    sfc /scannow

    to restore damaged system files. (Reference: reinstall dfrg.inf / KB guidance via ITPro/KB 922379.)

  1. Workarounds and alternatives
  • Create a fresh console: run mmc /a, use File → Add/Remove Snap‑in and add Disk Defragmenter, then Save As a new .msc (this avoids version/console mismatch). (MMC usage docs.)
  • If the GUI still fails, use the XP command‑line defrag as a fallback:
    defrag c: -f

    to force defragmentation. (Microsoft documentation for defrag.exe.)

If none of these restore the GUI, check Event Viewer for exact MMC/errors and consider a repair install or restoring SP2 after applying the above fixes — uninstalling a service pack is not a long‑term security solution. Relevant Microsoft references and step details are linked above for each repair step.

Recommended Answers

All 3 Replies

You'll find information about making changes to Windows services at

commented: Nice find! +2

Tried the blackviper solution (very useful one btw) but still couldn't defrag. Decided to just uninstall SP2, and just use the hotfixes from MS support. HD defrags fine now but can't reinstall SP2 again, guess I'll just have to live with it since it's running stable. Thanks for your help!

Kurt

Before you uninstalled SP2 did you try this?
Go to the Control Panel and open Administrative Tools; double-click on Services, scroll down to Windows Installer, right-click on it and select Properties. Change Startup Type to Automatic. Reboot and try Defrag again.

If not, give it a try next time you decide to give SP2 a shot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.