Fix MMC Cannot Open the File C:\WINDOWS\system32\dfrg.msc Problem
One of my client’s computer encountered a problem which is unable to run Windows Disk Defragmenter. Windows Disk Defragmenter is a computer program included in Microsoft Windows designed to increase access speed (and sometimes increase the amount of usable space) by rearranging files stored on a disk to occupy contiguous storage locations, or defragmenting. The purpose is to optimize the time it takes to read and write files to/from the disk by minimizing head travel time and maximizing the transfer rate.
The problem is whenever he tries to run the Disk Defragmenter shortcut from Start > Programs > Accessories > System Tools > Disk Defragmenter, only an error window appears:
MMC cannot open the file C:\Windows\system32\dfrg.msc. This may be because the file does not exist, is not an MMC console, or was created by a later version of MMC. This may also be because you do not have sufficient access rights to the file.
Here are some suggestions on how to fix running disk defragmenter problem in Windows.
One of the methods below should be able to help you restore Windows Disk Defragmenter. Try the first solution and then run Disk Defragmenter. If it didn’t fix the problem, continue with the second one and etc.Solution 1: Make sure you have rights to run Microsoft Management Console (MMC) and MSC file.
Solution 2: Go to Start > Run, type regsvr32 msxml3.dll and click OK.
Solution 3: Go to Start > Run, type regsvr32 dfrgsnap.dll and click OK. Then again go to Run, type regsvr32 dfrgui.dll and click OK.
Solution 4: Go to C:\Windows\Inf, right click at dfrg.inf file and select Install.
Solution 5: Go to Start > Run and type sfc /scannow. Make sure you have your Windows XP installation disc in the CD/DVD drive.
Solution 6: Download and apply .MSC association fix.
Solution 7: Download and apply Defrag SnapIn registry fix.
Solution 8: Download and install latest MMC 3.0 from Microsoft.
One of the methods above should be able to help you restore your disk defragmenter. But for my case, I’ve gone though all methods above and it still doesn’t restore Windows Disk Defragmenter. Every time I run defrag, I still get the error MMC Cannot Open the File C:\WINDOWS\system32\dfrg.msc. After days of trying, finally I just decided to rename the dfrg.msc file at C:\WINDOWS\system32\ to dfrg-renamed.msc. I ran dfrg-renamed.msc, and I was shocked to see that it was able to run! So I created a shortcut for dfrg-renamed.msc and place it at Start menu and desktop for my client.
Until today I still couldn’t figure out what is causing this weird behavior but this workaround allows me to run Disk Defragmenter without getting the MMC Cannot Open the File C:\WINDOWS\system32\dfrg.msc error. I’d appreciate if you can share with me what might be the cause of this problem and how to really fix it.
Downgrade the msxml3.dll also works. After downgrade it, do regsvr32 msxml3.dll, then it says success. Newer msxml3.dll needs more requirements that our Windows didn’t have.
Yeah, msxml3.dll is the problem. I tried the regsvr32 msxml3.dll, but it says something like LoadLibrary failed or something else. For 3 months I Googled about my problem, found so many websites that says it is already solved, but none them works for me. So, I tried to, like replace the msxml3.dll. I go to this website, dll-files.com/dllindex/dll-files.shtml?msxml3 and try to upgrade my msxml3.dll, to show the current version of the msxml3.dll, I just go to the directory where msxml3.dll was placed, then I hover over it, then my cursor tells the description including it’s version. After I upgraded the msxml3.dll, I tried the regsvr32 msxml3.dll, the LoadLibrary failed still pops up. I tried to downgrade it to the lowest version, I tried the regsvr32 msxml3.dll, BOOM!!! Surprisingly, it says DllRegisterServer in msxml3.dll suceeded. Then I try to open Device Manager (devmgmt.msc), it works! Well, I think newer version of msxml3.dll needs more requirements, that’s why it doesn’t want to be registered.
Very Very good. My problem abaut defrag was brillianty solved.
After trying everything else several times and several hours, my last resort was to change the file name from “dfrg.msc” to “dfrg-rename.msc” and it worked. Thank you sooooo…. much.
Thank You So much.
My Problem got solved from step 1- step 4.
Cheers Bro…. you are a genius Man.
Hats Off To You….
Solution 8 worked for me, also. Greatly appreciated.
Thanks.
Problem solved with solution 5, thanks
just go to control panel in that select adiministrative tool. than select computer management, than select storage and finally defragmenter. its works in that format
Thank you. for me the solution no.8 is really works.
Solution 8 worked for me. Thanks.
Thank you so-so much. For me only Solution 2 worked.
Thanks man, option 8 solved my problem!
Thank you very much, renaming of dfrg.msc to [anything].msc works indeed. However I really want to find a fix instead of workaround, to have the “Defragment now” button working.
You are great, I renamed the file, and it solved my problem too, thanks a lot!
Save yourself a lot of trouble rename the dfrg.msc file at C:\WINDOWS\system32\ to dfrg-renamed.msc or dfrg-(insert anything).msc The change all of your short cuts.
This really works and is VERY simple!!!!
rename to dfrg.msc worked
Thank you so much!!!! #8 worked!!!
Thanks a whole bunch to Raymond for your help. Your solution #2 solved my defrag problem!
Wanted to share may successful defrag tool repair.
With the help of this article and a little luck …
Per Solution 8: I download and install latest MMC 3.0 from Microsoft. support.microsoft.com/kb/907265
There were other prerequisite per microsoft’s website:
For Windows XP, x86-based versions, you must have Windows XP Service Pack 2 (SP2)… and …
Version 2.0.50727 of the Microsoft .NET Framework to run managed framework snap-ins that are designed and built for MMC 3.0.
I obviously had SP2 but I needed the Version 2.0.50727 of the Microsoft .NET Framework.
Then went back to the Solution 3 from this article.
Go to Start > Run, type regsvr32 dfrgsnap.dll and click OK. Then again go to Run, type regsvr32 dfrgui.dll and click OK.
It worked for me after that ! :))
Also from this article you may need solution Solution 4: Go to C:\Windows\Inf, right click at dfrg.inf file and select Install.
Hope that helps.
Thanks bro !!!
It is working !!!!
This actually works!! I have spend 2 and a half hours trying to find a program that will work for my computer. Tried this and It works. I am totally grateful.
Wow, just went through all the solutions and low and behold #8 was the winner!
I can’t believe it!
Cheers…. you are a genius.
Bill
Thanks man…renaming to dfrg.msc worked since it was only labeled as dfrg.
tHANKS BRO, It’s work!
ok, I tried several things at once and I don’t know which of them really helped :) First I tried solution no2 but with all msxml*.dll files (there are 3 of them). Funny is that exactly with msxml3.dll I failed – some error about something :) So I downloaded msxml3.dll and replaced mine. Still no go with regsrv32. Then I launched reg files mentioned in sol no 6&7. Finally I restarted machine and everything was ok, all msc’s working now.
Thanks for this one. it really helps. til next time! i hope you contribute more to fixing anything about computers
I solved the problem by adding new item in the mmc console:
Go to Start > Run and type mmc
then add new item in the console:
File>add/remove>add>disk defragmentation
then save the console.
That’s it. It works.
(It also works with renaming of dfrg file)
TKS!!!! Finally works the last one (download & reinstall MMC)
Man you rock, solution 8 saved my day….
Just to let you know i read about it and for my case what caused the problem was that i installed service pack 3 and i had some problems. After i removed service pack 3 then probably it removed also the dfrg.msc…..
thaks of lot, solution 8 resolved my problem. Thanks again.
Had same problem with different .msc, renaming was my only solution. Problem started after MS update
Great work! Thanks… downloading and re-installing MMC from Microsoft did the trick for me!
I just renamed the dfrg.msc file and now my defrag works fine… I tried the Hotfix first but that did help.
Many thanks MAN!!!
Thanks man it also fixed my system restore as that wouldn’t work earlier a trojan caused the dll to turn itself off It was a trojan in back up in the system 32 folder,again thank you.
Thank you SO much, I contacted HP who told me to do a system restore on my 1.5 year old media center pc, Ive already done 2 since purchasing this pc, and that seems to be their solution to everything when they don’t know how to fix a problem. I followed your advice EXACTLY after removing IE8 from my pc, which I believe the problem began After downloading the Beta version IE. It also caused a problem with my Help and support application on the pc. After performing each of your solutions, I rebooted my computer and Now Everything works like new. Thank you again for your kind advice and posting it so others could get their systems up and working again!
Thanks a lot! Solution 8 worked for me. God bless you :-)
just did this for a client, thank for everything.. not sure why its coming..
many thanks Raymond, #8 stopped my hairfall :)
thanks man, #8 did it for me, took me like 15 min or so to figure out what to do for it but i eventually got it and now my defrag works
Your the solution after #8 fixed the problem i renamed and pinned it to the start menu thanks for your research and solutions God bless you Mightly!!!
Stewart is right..this problem is almost always caused by Diskeeper in a normal users computer. The reason you can’t find it is because, they have uninstalled it long before (which is the cause of the problem).
You Rock! I’ve been hours trying to fix my disk defragmenter. 20 minutes on your page and…problem solved! #8 worked for me.
Thanks
I had a similar problem once (with another program). The REN seemed to also solve my problem. Several days later, I REN’d it back to its original name, and it worked. I think Windows gets dyslexic sometimes, or the NTFS might get corrupted. The REN seems to correct the problem for some reason.
See this maybe once a year.
In my experience its sometimes caused by removing too much with nLite and sometimes by a poor uninstall of Diskeeper.
I’m not criticising these products.
I’ve written a crude batch file that simply replaces/overwrites the appropriate files and/or registry keys.
ooh! i actually have had this problem before! though back then, i didn’t know what to do so i just rebooted :/