Repair the builtin disk defragmenter

Symptoms:
The builtin Disk Defragmenter might stop working if having installed a 3rd party defragger and uninstalled it again.

When using the Defrag.exe (XP only) command line tool, then it does not start and one gets the following error message:

Windows cannot connect to the Disk Defragmenter engine.

When opening Properties for a local hard disk, the one either will see a gray Defragment Now-button, or when clicking the button one gets the following error message:

The Disk Defragmenter is not installed on your computer. To install it, double-click the Add or Remove Programs icon in Control Panel, click the Install/Uninstall tab, and then follow the instructions on your screen.

When trying to open the Disk Defragmenter snapin, then one gets the following error message:

Snap-in failed to initialize,
CLSID: {43668E21-2636-11D1-A1CE-0080C88593A5}

Solution:
To repair the Disk Defragmenter execute the following two commands:
  • regsvr32 dfrgsnap.dll
  • regsvr32 dfrgui.dll
If the above actions didn't help, then right click the following file and select Install:

C:\Windows\Inf\dfrg.inf

Note this issue can also be caused by having disabled the XP SP2 service DCOM Server Process Launcher. This service must be configured to Automatic and be running for the Disk Defragmenter to work.

Note if having disabled or set a low custom size for the pagefile, then defrag might not work. If using WinXP set the virtual memory to "System Managed Size".

More Info MS KB922379

Credits AndreasRoom.com

Updated: 3 April 2008

Comments:

  1. Kedar Gore says:

    Thanks a lot for all the above steps and guidelines...
    The "Defragmentor" has started working!!

  2. Daron says:

    I have tried all of the above mentioned remedies, no luck. I think my problem started after installing and removing windows steady state. Can't even run it from safe mode. Any other suggestions? Thanks! (nothing happens when hitting buttons. changed page file to system mangaged. dcom was and is set to automatic.)

  3. darlene says:

    i have tried these steps and still no luck running the defrag

  4. wild_bill says:

    If these don't work, then maybe you should just try a 3rd party defragger which works as well, if not better than the windows version. I like UltimateDefrag...just google it.

  5. Francisco Brito says:

    Thanks! this worked for me!

    I started having this problem after performing windows update and also regitry cleaning with several cleaners.

  6. hardik says:

    please do any other help for dfrag. when i press dfregment then error is coming c:/windows/system32/dfrag.msc access is denited.

  7. Snakefoot says:

    hardik wrote:
    when i press dfregment then error is coming c:/windows/system32/dfrag.msc access is denited.

    Are you logged in with an Administrator account. If so then you can try to change the NTFS permissions to defrag.msc.

  8. Al Miles says:

    When I attemt to launch Disk Defragmenter I receive an error message:Disk Defragmenter could not start. What do I do next. I have set DCOM to Automatic and restarted the machine. Still no luck.

    Al

    P.S. Using XP Pro

  9. Snakefoot says:

    Al Miles wrote:

    When I attemt to launch Disk Defragmenter I receive an error message:Disk Defragmenter could not start.

    Have you tried to reinstall defrag, as described in the article ?

  10. GCR says:

    Thanks for the fix info. I had forgot about using Install on the dfrg.inf
    file.

  11. Corey says:

    Thank you! Executing the two commands you provided solved the problem perfectly.

  12. Tsai Christine says:

    When I run Disk defrafmenter then i can't run
    I got the message as following:
    Disk Defragmenter have detected that CHKDSK is scheduled to run on the volume (C): please run chkdsk /f

    Please help me to solve this problem
    Thanks.

  13. Snakefoot says:

    Tsai Christine wrote:
    Disk Defragmenter have detected that CHKDSK is scheduled to run on the volume (C): please run chkdsk /f

    Try to restart the computer, and let it complete the Chkdsk operation.

    If it continues to request chkdsk to be run after the reboot, then run this command and restart again:

    CHKNTFS /D

  14. Mark says:

    I have tried everything mentioned above. When I try to analyze on disk defragmenter I get a message
    Disk defragmanter could not start."

    I click ok. and nothing happens. I have tried installing dfrg.inf and my defragmenter still does not work. I have also tried to install 3 party defragmenters, but everytime i try to analyze with them, the say they have encountered and error and have to close. Please help me with this problem, I dont know what to do! Thanks.

  15. benedict says:

    my os is windows xp home edition, i already tried your suggestion still no luck, can someone here know how to help me with my disk defrag,

  16. Fede says:

    It works !!
    you ruleeee !! ;)

Leave a Reply

Your email address will not be published. Required fields are marked *