Thursday, May 12, 2011

How to Register 32 bit dll on 64 bit Windows

Trying to register a 32 bit dll on a 64 bit system running Windows fails and gives the error-
Filename.dll is not an executable file and no registration helper is registered for this file type.

The reason :
This happens because even though you intend to access the 32bit version of regsvr by typing regsvr32, it actually opens the default 64 bit regsvr that lies in the system directory(of 64 bit Windows).
That is, when you run regsvr32 to register a dll, you are actually running the 64 bit version by default.

The solution:

To resolve this issue, run Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For that
1st save the dll file in c:\windows\syswow64
Now, open the command prompt by 
Click on Start-->Click on Run-->type cmd
else press Win button (the one in between Ctrl and Alt on the bottom left hand corner of of keyboard, near the space bar) and R. ie press Win and R .

and then type the following commands to register the DLL:
cd \windows\syswow64
regsvr32 filename.dll 
(replace filename with the actual name of dll file) 
P.S.: The Syswow64 folder contains the 32-bit versions of Windows program files and DLLs.


Apurva said...

it would be better if you give some intro regarding this topic specially for noobs like me in which situation will one require to do this , what exactly is regsvr etc...

optimystix said...

Sorry for the inconvenience caused. This topic was meant to be a troubleshooting one and therefore was straight to the point. Will put up the information on the topics you required on a separate post.


Post a Comment

Please post your comments on whether you liked it and what else would you like me to write on. Suggestions of all types are welcome.