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?
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?
And while doing this, if you get error code 0x80040201, try the solution in DllRegisterServer failed with the error code 0x80040201, but make sure, you open command prompt as Run as Administrator.
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.)
Everything here was failing as wrong path. Then I remembered a trick from the old Win95 days. Open the program folder where the .dll resides, open C:/Windows/System32 scroll down to regsvr32 and drag and drop the dll from the program folder onto rgsrver32. Boom,done.
Part of the confusion regarding regsvr32 is that on 64-bit windows the name and path have not changed, but it now registers 64-bit DLLs. The 32-bit regsvr32 exists in SysWOW64, a name that appears to represent 64-bit applications. However the WOW64 in the name refers to Windows on Windows 64, or more explicity Windows 32-bit on Windows 64-bit. When you think of it this way the name makes sense even though it is confusing in this context.
I cannot find my original source on an MSDN blog but it is referenced in this Wikipedia article http://en.wikipedia.org/wiki/WoW64
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:
Solution from that article:
I just tested this extremely simple method and it works perfectly--but I use the built-in Administrator account, so I don't have to jump through hoops for elevated privileges.
The following batch file relieves the user of the need to move files in/out of system folders. It also leaves it up to Windows to apply the proper version of
Regsvr32
.INSTRUCTIONS:
In the folder that contains the library (
-.dll
or-.ax
) file you wish to register, open a new text file and paste in ONE of the routines below :Save your new text file as a batch (
-.bat
) file; then simply drag-and-drop your-.dll
or-.ax
file on top of the batch file.If UAC doesn't give you the opportunity to run the batch file as an Administrator, you may need to manually elevate privileges (instructions are for Windows 7):
Create shortcut
;Properties
;Compatibility
tab;Run this program as administrator
;-.dll
or-.ax
file on top of the new shortcut instead of the batch file.That's it. I chose
COPY
instead ofMOVE
to prevent the failure of any UAC-related follow-up attempt(s). Successful registration should be followed by deletion of the original library (-.dll
or-.ax
) file.Don't worry about copies made to the system folder (
C:\Windows\System32
orC:\Windows\SysWOW64
) by previous passes--they will be overwritten every time you run the batch file.Unless you ran the wrong batch file, in which case you will probably want to delete the copy made to the wrong system folder (
C:\Windows\System32
orC:\Windows\SysWOW64
) before running the proper batch file, ...or...Help Windows choose the right library file to register by fully-qualifying its directory location.
C:\Windows\System32
C:\Windows\SysWOW64
%nx1
regsvr32 "C:\Windows\System32\%nx1"
regsvr32 "C:\Windows\SysWOW64\%nx1"
%nx1
from system folder pathRun this shotgun batch file, which will (in order):
C:\Windows\System32
;C:\Windows\System32
;C:\Windows\SystemWOW64