• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

Registering a DLL that has been previously registered

Hi all

does anyone know what happens in the following scenarios dealing with DLLs on Windows machines:

1. An existing DLL has been registered with Windows, I replace the physical .dll file and then register the new file again (note: no unregistering process first).

2. I attempt to unregister a DLL that is currently not registered with Windows.

Specifically, I am executing the commands below from a command prompt:

regsrv32 /s "path to dll" - register DLL
regsrv32 /s /u "path to dll" - unregister a DLL

I need to know if either scenario will fail (and return a failed error code to my batch file) or if it will succeed. Success in my case would mean:

1. New dll gets registered successfully (even though the old wasn't unregistered)
2. Command gets ignored since dll isn't registered

Ideally, the process is:

unregister existing dll
replace physical file
register new dll

The problem is that I may not be able to follow this ideal process from my code and that I could end up in a situation where I attempt to unregister a dll that was never registered or I attempt to reregister a dll without doing the unregister it first.

Any help is much appreciated.
1 Solution
Without unregistering the old dll you might orphan some registry information.

Just registering the new dll should create everything it needs to run properly so unregistering the old is unnecessary but would be cleaner if you could unregister the old first.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now