How do I register a DLL file on Windows 7 64-bit?
Solution 1
Type regsvr32 name.dll
into the Command Prompt (executed in elevated mode!) and press "Enter." Note that name.dll
should be replaced with the name of the DLL that you want to register. For example, if you want to register the iexplore.dll, type regsvr32 iexplore.dll
.
Solution 2
Well, you don't specify if it's a 32 or 64 bit dll and you don't include the error message, but I'll guess that it's the same issue as described in this KB article: Error Message When You Run Regsvr32.exe on 64-Bit Windows
Quote from that article:
This behavior occurs because the Regsvr32.exe file in the System32 folder is a 64-bit version. When you run Regsvr32 to register a DLL, you are using the 64-bit version by default.
Solution from that article:
To resolve this issue, run Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For example, type the following commands to register the DLL:
cd \windows\syswow64
regsvr32 c:\filename.dll
Solution 3
If the DLL is 32 bit:
Copy the DLL to C:\Windows\SysWoW64\
In an elevated command prompt: %windir%\SysWoW64\regsvr32.exe %windir%\SysWoW64\namedll.dll
if the DLL is 64 bit:
Copy the DLL to C:\Windows\System32\
In an elevated command prompt: %windir%\System32\regsvr32.exe %windir%\System32\namedll.dll
I know it seems the wrong way round, but that's the way it works. See:
http://support.microsoft.com/kb/249873
Quote: "Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:
The 64-bit version is %systemroot%\System32\regsvr32.exe.
The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.
"
Solution 4
On a x64 system, system32 is for 64 bit and syswow64 is for 32 bit (not the other way around as stated in another answer). WOW (Windows on Windows) is the 32 bit subsystem that runs under the 64 bit subsystem).
It's a mess in naming terms, and serves only to confuse, but that's the way it is.
Again ...
syswow64 is 32 bit, NOT 64 bit.
system32 is 64 bit, NOT 32 bit.
There is a regsrv32 in each of these directories. One is 64 bit, and the other is 32 bit. It is the same deal with odbcad32 and et al. (If you want to see 32-bit ODBC drivers which won't show up with the default odbcad32 in system32 which is 64-bit.)
Solution 5
Open the start menu and type cmd into the search box Hold Ctrl + Shift and press Enter
This runs the Command Prompt in Administrator mode.
Now type: regsvr32 MyComobject.dll
Related videos on Youtube
Comments
-
Rajkumar Reddy almost 4 years
I have tried to use the following code:
cd c:\windows\system32 regsvr32.exe dllname.ax
But this is not working for me. How can I register a DLL file on Windows 7 with a 64-bit processor?
-
Cody Gray over 13 yearsSeeing as this question is tagged "vb.net", I have to wonder why you're trying to register a DLL you created in VB.NET. To be used with
regsvr32
, a DLL must export the functionsDllRegisterServer
andDllUnregisterServer
. There's no register the vast majority of DLLs that you create at all. -
Cody Gray over 13 yearsWhat do you mean by doesn't work or isn't useful? Do you get an error message? What does it say?
-
-
Josh McKearin over 11 yearsIf you have already copied the filename.dll to the syswow64 folder, and you change working directory to syswow64 in command prompt, then the "c:\" in "regsvr32 c:\filename.dll" is not necessary. In short, "regsvr32 c:\filename.dll" should read "regsvr32 filename.dll"
-
Trevor Boyd Smith about 11 years+1 for "I know it seems the wrong way round, but that's the way it works" with link to support.microsoft.com... w/o the link it's hard to believe.
-
shindigo over 10 years"In elevated cmd" is very important!!
-
Mike Devenney about 10 yearsWhy is this not the selected answer?
-
workabyte almost 10 yearsthis works but could be problematic if you need to run this as an admin.
-
Rob over 9 yearsThis really should be the correct answer. I can understand that in his original post the syntax was incorrect but Rajkumar commented that he was receiving an error message even when using the correct syntax. This takes two steps to the correct answer for someone searching instead of one. First to the answer selected as correct, then following the comment chain, ending up on this post.
-
R K Sharma over 9 years
regsvr32
path of the .dll file with filename and extension and press enter -
Sk8erPeter over 8 yearsWhy does it matter?
regsvr32
will take care about the details, theoretically it will detect whether you are registering a 32 bit or 64 bit DLL: stackoverflow.com/questions/18935163/… -
Jon Grah almost 7 years
Run as administrator
is greyed out when I created a shortcut for the bat file. I am logged in as administrator. Also, is it%nx1
or%n1
?