Server Fault is a question and answer site for system and network administrators. 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

I am trying to uninstall a DLL from the C:\Windows\Assembly "folder" on Windows Server 2008, but am getting a "permission denied" error. How do I go about removing a DLL without uninstalling the entire application?

An application vendor has sent me new DLL's, with no instructions on how to remove the old version or add these new ones. Google hasn't been as helpful as usual, either...

share|improve this question
I am not sure, but perhaps you need to unregister it with regsrv32 and register the new one? Make sure try to use that from an elevated shell. – Zoredache Sep 1 '10 at 22:20
This was on a 64-bit server, so that didn't work, either. Using \windows\syswow64\regsvr32 c:\filename.dll may be an option. – SturdyErde Sep 1 '10 at 22:24
Using regsvr32.exe or \windows\syswow64\regsvr32.exe would be an option for most DLL's, but I don't think it can uninstall from the GAC. I have posted my solution below. – SturdyErde Sep 1 '10 at 22:30
up vote 3 down vote accepted

This didn't work before, but thankfully did on my last attempt. Go figure...

I found gacutil.exe on the server and ran gacutil -u dllName.DLL Installing the new DLL was simply gacutil -i "PathAndFilenameOfNewDLL"

share|improve this answer

I know I'm late to the party, but here is another solution using Powershell if you do not have gacutil.exe present. Gacutil is a development tool and normally isn't present on production systems.

Fire up PowerShell using an elevated prompt by right-clicking on it and selecting "Run As Administrator." Then type or copy/paste the following:

$pathToFile = 'PathAndFilename.dll'
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish

If you want to install a copy to the GAC, change the last line to this:

share|improve this answer
A great and important solution for test systems where GacUtil is not available. Worked great for me once I realized how important the quotes around the DLL name are. – BlueMonkMN Jun 5 '15 at 21:27

Put gacutil /u in a cmd file and run by right clicking and selecting Run As Administrator. This worked where everything else suggested failed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.