Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I register a DLL file on Windows 7 64-bit?

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?

like image 321
Rajkumar Reddy Avatar asked Feb 04 '11 11:02

Rajkumar Reddy


People also ask

How do I register a DLL file in Windows 7?

Click Start > All Programs > Accessories and right-click on "Command Prompt" and select "Run as Administrator" OR in the Search box, type CMD and when cmd.exe appears in your results, right-click on cmd.exe and select "Run as administrator" At the command prompt, enter: REGSVR32 "PATH TO THE DLL FILE"


2 Answers

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

like image 143
Hans Olsson Avatar answered Oct 17 '22 07:10

Hans Olsson


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.
"

like image 41
Liam Avatar answered Oct 17 '22 06:10

Liam