Windows Server

Managing DLLs in Windows Server 2003


There are many reasons why an application might not install completely or correctly. One common reason for a problem installation is corrupt, missing, or nonregistered Dynamic Link Libraries (DLLs). This tip will go through what a DLL is, what it does, and will give an overview of the tool for manually registering and unregistering these files with the Windows Server 2003 operating system.

What is a DLL?

There may already be a DLL contained in Windows Server 2003 that performs certain functions. If this is true, the application can call the existing DLL, eliminating the need to rewrite the code.

This sounds like a developer issue, so why do I need to care about it?

DLL files affect administrators because the files fail to register with Windows upon installation of an application. If the DLL files are not properly registered, the application will not function as designed and, in many cases, will not start at all.

To register a DLL in Windows Server 2003, there is a simple command line tool available. Follow these steps:

  1. Open a command prompt.
  2. At the prompt, type regsvr32 "path to DLL file".
  3. Press [Enter].

Note: You may replace only third-party DLLs or DLLs installed by hotfixes, service packs, or other updates. Windows does not allow alteration of protected system DLLs.

If you need to uninstall a registered DLL, you can add the /u switch to the command. Here is a quick example:

  1. Open a command prompt.
  2. At the prompt, enter the following command to register mynewdll.dll: Regsvr32 mynewdll.dll <enter>. You will get a message in the command prompt window letting you know if the registration succeeded or failed.
  3. To uninstall a registered DLL, enter the following at the command prompt: Regsvr32 /u mynewdll.dll <enter>. A command line message will let you know if the operation succeeded or failed.

Miss a Windows Server 2003 tip?

Check out the Windows Server 2003 archive, and catch up on the most useful tips from this newsletter.

Stay on top of the latest Windows Server 2003 tips and tricks with our free Windows Server newsletter, delivered each Wednesday. Automatically sign up today!

About

Derek Schauland has been tinkering with Windows systems since 1997. He has supported Windows NT 4, worked phone support for an ISP, and is currently the IT Manager for a manufacturing company in Wisconsin.

40 comments
arasakumaran
arasakumaran

I have a Com dll that needs to be registered. regsvr32 works fine in the XP machine where it was developed. moving the file to Windows Server 2003 and trying the same command line gives an error message "Load Library ("MyDLL.dll") Failed. This application failed to start because the application configuration is incorrect.Reinstalling the application may fix the problem." Does anyone have any light to shed.

dharmesh.kelawala
dharmesh.kelawala

can we replace dll files on the fly on windows 2003 server ? is there any kind of program we have to run. can we just replace dll file without rebooting the server ?

basharath2
basharath2

Can anybody take pain to bring the correct information about DLLssss! to all of us in dilemma? TechRepublic has not been so unanswerable before..........:-(

laman
laman

Did I need the whole articule on how to use the regsvr32 command? I was expecting John to tell me how to distinguish one and the others and whether they have to be registered or can be unregistered.

delong201
delong201

Good Explaination what's the DLLs and how/why use DLLs, but can't belive someone still use Regsvr32 to manage DLLs in Windows Server 2003.

seanferd
seanferd

First, I hope the folks who don't know what a Dynamic Link Library is, or why it needs to be registered aren't developers or SysAdmins. :) I agree that the article doesn't live up to the description in the newsletter, but maybe that wasn't written by the article's author. So: A dynamic link library is a file with the extension .dll, .ocx, .drv, .cpl, and some others. They are executable files that work with EXEs (applications), and known as application extensions. They are used so that all the code needed for an app doesn't have to reside in one giant file. Microsoft's Windows DLLs are used by Windows and a lot of other apps that don't have to duplicate the effort of providing all the run time environment framework because it is already available in a usable form. Some DLLs can be run like an app using Rundll32.exe, but that is an entirely different article. For the DLLs that require registration, it is because Windows and other programs need to be able to find them through the registry database. Here is when you might want to register a DLL: you get an error message on an application start-up saying that somedll.dll is missing. You look around your drive and find that, in fact, the required DLL of the correct version is resident in the /system32 directory, or that you have a copy of the file elsewhere and can copy it to the machine with the problem. What you need to do here is register the DLL so it can be used by an app that requires it. Does this help anyone out? See also: lauristone's post, and maybe Wikipedia, microsoft.com, various others available by search. edited for missing W. (L-Shift+w seems to be malfunctioning on my kbd.) What the heck?

greg.hruby
greg.hruby

This article effectively a variant of "DLL-hell" where the contents of the module(s) do not support the operation the whole.

bmatt
bmatt

Didn't describe anything. Bad article.

DougPackerUK
DougPackerUK

I can't believe this article! It says "Derek Schauland goes through what a DLL is, what it does, and will give an overview of the tool for manually registering and unregistering these files with the Windows Server 2003 operating system" Where's the "what it is - exactly"? and where's the "what it does"? Tech Republic - time to raise the bar on quality of articles

basharath2
basharath2

It would be helpful if someone throws light on why we need to register and unregister dlls.

KeReleaseSpinLock
KeReleaseSpinLock

Only DLL's exposing one or more of the standard COM interface standards(may) need regsvr32.

seanferd
seanferd

What is it about dll files that you want to know? Several people, including myself, have tried to answer the posted questions. Most would be happy to answer any questions you have. I will answer any question that I can. Just keep in mind that TR is not school for the basics of computing. It is a site mostly geared for IT professionals. You can always do web searches for items you want to learn more about. Anything concerning Windows is best found at microsoft.com and other, independent Windows sites. Again, I, and others, would be happy to answer your questions, or direct you somewhere that has the information you seek.

cathysgardens
cathysgardens

Quickreg sounds like the way to go but, Could you use the system file checker and insert your xp or whatever cd instead to get the dll you need?? just curious. Cat

basharath2
basharath2

It would be good if some gives explanation to regsvr32 command line with switches. My second question why dlls need to be unregistered is still unanswered.....

Craig_B
Craig_B

Thank you for taking the time and explaining this. I got more out of your post than the original article!

bruce_goodman
bruce_goodman

Further, some hints on how to identify which dll(s) may need manually registering would have been useful.

Rob C
Rob C

I use VB6, and was around when VB went from 16 bit to 32 bit. That scared the heck out of me, and I have tried to avoid dependencies ever since. If I could have one wish granted by MS, it would be that any DLL, ocx, placed in the same folder as the executable, could be used without requiring registration. If Bill had worked in a mainframe IT dept in a bank for 10 years, he would have learned how important it is to have a production environment that is 'bullet proof'. If then he had invented Windows, it might have been more stable/reliable for businesses who depend on it. Rob

geniusmind4
geniusmind4

Well my problem is that....under management folder there is no maintenance plan wizard neither when i right click on maintenance plan there is any NEW button ... all i can see is Reports and Refresh button in my sql server management studio... whts the solution

basharath2
basharath2

Can we replace dll files if they are corrupted? What if I do not have windows install cd at the moment and want to run SFC? Can we replace the dll files getting it from internet in this situation?

Cuffy10
Cuffy10

I don't think we're on the same page! Quickreg won't help if you need a DLL. Quickreg simply registers certain types of files in your registry so the file can be found when called by an application that uses it. SFC will extract a DLL from your OS CD if it's determined that the installed file is corrupt but I don't think SFC is the tool to use to register or unregister a file.

seanferd
seanferd

Type regsvr32 in Run box for usage notes. Visit microsoft.com. They document their OS. If you haven't had the need to unregister a dll, don't worry about it. Unregistering dll files occurs when uninstalling software. This generally is not a manual operation. However, if you needed to replace a registered dll, you would have to unregister it first. Example: you receive an error message upon starting an application: A required file, somedll.dll is missing or corrupt. You find the referenced file on you system and register it, but receive the same error message at application start-up again. Therefore, the file was corrupt, not missing or only unregistered. If you choose to replace this dll with a good copy, you will have to unregister it first, or the filesystem won't let you copy over the bad one. Most folks would just re-install the application or even the OS, depending on which owns the dll. If re-installing the entire app or OS is going to be a problem (like taking a server down), regsvr32 can be handy.

Kurse
Kurse

For one, you cant delete a .dll that is registered, it is considered "in use"

jbmv
jbmv

Your article is worth a lot more than the tech republic article. It gave me a better understanding of dll's. It wasn't complicated either. They should pay you for that article.

ichinutz
ichinutz

I'm glad someone thinks it's important enough to provide a definition for a 'DLL' file. After writing the header, 'What is a DLL?' the author of the article talks about something completely different. The definition of a DLL file that I remember is similar to the previous post. "It is a small program, or group of programs, that enhances the functionality of the application that called it."

seanferd
seanferd

It means that the thread cannot go any deeper in the current branch. You can do something like I did here, or post at a higher level. Edit: You can also see this thread for an example, it quickly devolves into entertainment. Maximum Level Has Been Reached And thanks for the link to the dll site.

cathysgardens
cathysgardens

Your a bundle of info.I was wondering if I could ask questions on techrepublic One more question what does Maximum level reached mean? Oh and maybe this can come in handy for you and basharath. http://www.dynamiclink.nl/frames/dll.htm and seanferd I was going to turn you into my new geek guru ,but I guess now I can just ask Tech lol lol Thanks again The Garden Cat

seanferd
seanferd

I try to help, if the subject is something that I understand fairly well. I know it can be difficult to get an answer sometimes, as many of the true professional people are kind of busy. I am just a decently informed amature who has a lot of experience fighting with Windows. I also wanted to make sure that you hadn't taken my "friendly warning" about software licenses the wrong way. I only mentioned it with the best of intentions. I am glad that I did not offend you. Best of luck to you, and take care. -Sean

basharath2
basharath2

I thank you for the above answer as it did solve my many questions. I find TR very helpful when I cannot decide or I am dubious of something. I get very helpful answers. Thanks again for the pain taken to write it.

seanferd
seanferd

Of course! Some systems do not come with an installation disk. There should have been an OS backup partition, though. SFC will get a file for you from the hard drive if the installation files are there. You may have to point SFC to these files, whether they are on their own special partition, or somewhere in the Windows directory. Some important files are also backed up in the System Backup directory (something like C:\Windows\Sysbckup). First of all, make sure that the dll is corrupted and not just improperly registered. Sometimes it is the registry that is damaged, not the file. (Unregister then register it, if you are getting an error message or SFC, or another utility, says it is missing or corrupted.) You can always run the SFC. If you have no installation backup, it just won't extract a file for you. Another thing to keep in mind is that the installation media may not even have the correct version of the corrupt file if it has been changed by Windows Update. Service Packs and Updates replace a lot of core files. My first suggestion here would be to go to the Windows Update site and run the Search for Updates tool either automatically or manually. You may get a good (and newer) copy of the corrupt dll there. Some Windows dll files do not necessarily ship with the OS. VB Runtime and .NET Framework files, for example, can be downloaded from Microsoft. Search Microsoft downloads for the file. Some Windows files are legally redistributable and can be found at Cnet Download.com, among other places. You can always do an internet search for the file, just make sure you get files from somewhere you can trust. No sense infecting your computer while you are trying to fix it. Also, make sure to get the same file version. Please note that if the corrupt dll does not belong to Windows, SFC will not help you. If it belongs to other software, (including Microsoft software), you'll need to have the appropriate install disk, or visit the vendor's website. I hope that answers your question, as that is pretty much all I've got, unless you have a very specific file in mind. On a final note: please don't expect the forums at TR to help you out if you are running a less-than-legal copy of Windows. I am not saying that you are, I just feel that I would not be behaving responsibly if I didn't say this. There are plenty of reasons to not have the installation software, but frequently, you can get a replacement disk for not much money from Microsoft, or an OEM vendor, if you have the license key. That alone may help you out. Cheers!

seanferd
seanferd

As I mentioned elsewhere in this thread, I myself am just a "pretty good" amature. One thing that you can do here, in the TR Forums, is to start your own thread by asking a question. Click on the Forums tab at the top of the page, then click the Ask a Question button. In this sense, Question refers to "help" type questions. Anything else can be used to Start a Discussion. My point here is, if you cannot get a query answered in some other thread, you can start your own, tailored to your needs. Just make sure you title your post in a descriptive (or eye-catching) manner. "Software re-installation failure" would be a title you could have used for your question re the NZ problem. You could always refer to the dll registration topic in your post. Anyway, I am glad I could answer your question here. I hope the software is behaving better for you now. PS: Sometimes it is good to uninstall stuff before installing again, even for those programs that have the "repair" option. Your method, however, deleting the bad dll, is actually what I would have probably done. Good move. Arriving at your own solution from the available info bodes well for you becoming a "power user". Maybe you'll be the one writing articles for the rest of us!

cathysgardens
cathysgardens

for your patience and simply put explanation I understand now I had a program(NetZero Email it stopped letting me write messages) I had the cd the program would install but would not fix the problem of message writing, it just keep saying it was missing or had a corrupt a dll. type file I found the file and renamed it and then the program could install because it could rewrite or registered itself, make a new dll. (could read itself again the right way) Right,thats what your talking about registering a dll. file. I've acquire so much knowledge from Tech Republic and people like you with your patience. That maybe someday I may be an IT pro. but please bare with us, less intelligent than you in the meantime. I've been a member for 2years and read every newsletter and most all forums and have just got to the point that I think I'm smart enough to ask questions Please don't take that away. You can't learn if you don't ask questions Thanks again.

seanferd
seanferd

Registering a dll is adding information to your local registry database. You do not need an internet connection to do this. It is not "product registration". Normally, yes, any program installation registers any dll that it needs to. This article is just a tip for folks who might need this capability. You will only need to register a dll if you are getting error messages, unless you are a developer or a sysadmin. Consumers generally won't do this. You can always fix a problem by re-installing the software. SFC: This will inform you if there is a problem dll, and assist you in extracting files from your Windows install disk. It will not help you if the dll didn't ship with Windows or come from a Windows update. Above all, this is not something to worry about for the average Windows user. It's just handy (in the non-IT arena) for somewhat advanced users to solve a dll registration error without re-installing entire software packages (sometimes this means Windows). Also, while SFC will notify you of a corrupt or missing dll, I don't know if it will help if you actually have the dll, but it is not registered, or registered improperly. This can happen because of a malware infection, or perhaps a misbehaving installation or uninstallation of a software package. Sometimes dlls just get unregistered, or the registration gets changed so that it is non-functional.

cathysgardens
cathysgardens

Now this is going to sound very stupid but does that mean you have to get on line to register the dll I never heard of registering a dll. that you already have on your pc wouldn't the program you installed do all that for you.And I know we are not on the same page because the article is so confusing.But you did answer my Question if its a corrupt dll file or missing dll file I could use the sfc and if it ever comes up to register a dll. I will definitely remember Quickreg. because I wouldn't have a clue as how to do it by myself.Oh and to register a dll. would it be a problem like the famous $$Micro$$ WGA as I got my pc at a garage sell Thanks Cat

seanferd
seanferd

I try to help, where I can, with what I know. Just don't ask me anything specifically about Windows Server, you can count me among the clueless in that venue.

Phil Haney
Phil Haney

Unlike a standard library of routines that gets linked to the program code at compile time (and included in the resultant EXE file), a DLL (Dynamic-Link Library) is an external library of routines that get (dynamically) linked to the source code (EXE file) at run time. Advantages include the ability to re-use the same code for more than one application, and the ability to update or modify one aspect of an application without having to recompile the whole thing. For example, if Microsoft wanted to change the appearance of their Office suite of applications (say, the way 3-D controls look), all they would have to do is change and distribute one DLL instead of releasing new versions of Word, Excel, etc.

Editor's Picks