Você está na página 1de 5

9/1/13

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

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Tell me more

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

I have tried to use the following code: c dc : \ w i n d o w s \ s y s t e m 3 2 r e g s v r 3 2 . e x ed l l n a m e . a x But this is not working for me. How can I register a DLL on Windows 7 with a 64-bit processor?
dll windows-7 64bit regsvr32 dllregistration

edited Feb 4 '11 at 12:06 Cody Gray 83.4k 10 118 205

asked Feb 4 '11 at 11:55 Rajkumar Reddy 367 2 7 23

Seeing 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 r e g s v r 3 2, a DLL must export the functions D l l R e g i s t e r S e r v e r and D l l U n r e g i s t e r S e r v e r. There's no register the vast majority of DLLs that you create at all. Cody Gray Feb 3 '11 at 11:41

What do you mean by doesn't work or isn't useful? Do you get an error message? What does it say? Cody Gray Feb 4 '11 at 12:08

10 Answers
Type "regsvr32 name.dll" into the Command Prompt 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."
answered Feb 4 '11 at 12:01

Haroldis 1,876 4 23 45 i used samething then also it's giving error message Rajkumar Reddy Feb 4 '11 at 12:07

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.

stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit

1/5

9/1/13
Solution from that article:

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

To resolve this issue, run Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For example, type the following commands to register the DLL: c d\ w i n d o w s \ s y s w o w 6 4 r e g s v r 3 2c : \ f i l e n a m e . d l l
answered Feb 3 '11 at 11:39 ho1 28.9k 8 34 57

If the DLL is 32 bit: Copy the DLL to C:\Windows\SysWoW64\ In elevated cmd: % w i n d i r % \ S y s W o W 6 4 \ r e g s v r 3 2 . e x e% w i n d i r % \ S y s W o W 6 4 \ n a m e d l l . d l l if the DLL is 64 bit: Copy the DLL to C:\Windows\System32\ In elevated cmd: % w i n d i r % \ S y s t e m 3 2 \ r e g s v r 3 2 . e x e% w i n d i r % \ S y s t e m 3 2 \ n a m e d l l . d l l 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. "
edited Nov 15 '12 at 11:42 SchmitzIT 2,321 4 12 29 answered Nov 15 '12 at 11:19 Liam 438 3 11

+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. Trevor Boyd Smith Mar 6 at 22:06 great this has solved the issue!! Davide Piras Apr 8 at 9:41

on a x64 system system32 is for the 64bit and syswow64 is for 32bit (not the other way around as stated above) 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 32bit NOT 64bit system32 is 64bit NOT 32bit there is a regsrv32 in each of these directories. one is 64bit the other 32. same deal with odbcad32 and et al. (if you want to see 32bit odbc drivers with won't show up with the default odbcad32 in system32 which is 64bit)
answered Oct 26 '12 at 13:11 phill 51 1 1

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: r e g s v r 3 2M y C o m o b j e c t . d l l
edited Oct 31 '12 at 9:55 Stony 4,417 6 13 25 answered Oct 31 '12 at 9:35 Sushant Rath 31 1

stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit

2/5

9/1/13

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

Knowing the error message would be rather valuable. It is meant to provide info, even though it doesn't make any sense to you it does to us. Being forced to guess, I'd say that the DLL is a 32-bit DirectX filter. In which case this should be the proper course of action:

c dc : \ w i n d o w s \ s y s w o w 6 4 m o v e. . \ s y s t e m 3 2 \ d l l n a m e . a x. r e g s v r 3 2 . e x ed l l n a m e . a x This must be run at an elevated command prompt so that UAC cannot stop the registry access that's required. Ask more questions about this at superuser.com
answered Feb 4 '11 at 13:51 Hans Passant 380k 36 287 624

Finally I found the solution just run CMD as administrator then write c d\ w i n d o w s \ s y s w o w 6 4 then write this r e g s v r 3 2c : \ f i l e n a m e . d l l I hope that answer will help you
edited Sep 28 '12 at 12:01 fancyPants 10.4k 7 15 33 answered Aug 14 '12 at 16:49 Hayder Chebaane 21 1

This was the only solution that worked for me. northpole Nov 15 '12 at 14:24 If 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" jpm0004 Jan 19 at 22:51

If the DLL is 32 bit: 1. Copy the DLL to C:\Windows\SysWoW64\ 2. In elevated cmd: %windir%\SysWoW64\regsvr32.exe %windir%\SysWoW64\namedll.dll if the DLL is 64 bit: 1. Copy the DLL to C:\Windows\System32\ 2. In elevated cmd: %windir%\System32\regsvr32.exe %windir%\System32\namedll.dll
edited Jun 9 at 11:05 Cairnarvon 4,833 7 13 32 answered Jun 7 '12 at 10:30 Dragos 49 5

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 R e g s v r 3 2. INSTRUCTIONS: In the folder that contains the library ( . d l l or . a x) file you wish to register, open a new text file and paste in ONE of the routines below : e c h oB E G I ND R A G A N D D R O P% n 1R E G I S T R A RF O R6 4 B I TS Y S T E M S c o p y% 1C : \ W i n d o w s \ S y s t e m 3 2

stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit

3/5

9/1/13
r e g s v r 3 2" % n x 1 " e c h oE N DB A T C HF I L E p a u s e

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

e c h oB E G I ND R A G A N D D R O P% n 1R E G I S T R A RF O R3 2 B I TS Y S T E M S c o p y% 1C : \ W i n d o w s \ S y s W O W 6 4 r e g s v r 3 2" % n x 1 " e c h oE N DB A T C HF I L E p a u s e Save your new text file as a batch ( . b a t) file; then simply drag-and-drop your . d l l or . a x 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): 1. 2. 3. 4. 5. 6. 7. Right-click on the batch file; Select C r e a t es h o r t c u t ; Right-click on the shortcut; Select P r o p e r t i e s ; Click the C o m p a t i b i l i t ytab; Check the box labeled R u nt h i sp r o g r a ma sa d m i n i s t r a t o r ; Drag-and-drop your . d l lor . a xfile on top of the new shortcut instead of the batch file.

That's it. I chose C O P Y instead of M O V E to prevent the failure of any UAC-related follow-up attempt(s). Successful registration should be followed by deletion of the original library ( . d l l or . a x) file. Don't worry about copies made to the system folder ( C : \ W i n d o w s \ S y s t e m 3 2 or C : \ W i n d o w s \ S y s W O W 6 4) 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 : \ W i n d o w s \ S y s t e m 3 2 or C : \ W i n d o w s \ S y s W O W 6 4) before running the proper batch file, ...or... Help Windows choose the right library file to register by fully-qualifying its directory location. 1. From the right batch file copy the system folder path If 64-bit: C : \ W i n d o w s \ S y s t e m 3 2 If 32-bit: C : \ W i n d o w s \ S y s W O W 6 4 2. Paste it on the next line so that it precedes % n x 1 If 64-bit: r e g s v r 3 2" C : \ W i n d o w s \ S y s t e m 3 2 \ % n x 1 " If 32-bit: r e g s v r 3 2" C : \ W i n d o w s \ S y s W O W 6 4 \ % n x 1 " Paste path inside quotation marks Insert backslash to separate % n x 1from system folder path or ... Run this shotgun batch file, which will (in order): 1. Perform cleanup of aborted registration processes Reverse any registration process completed by your library file; Delete any copies of your library file that have been saved to either system folder; Pause to allow you to terminate the batch file at this point (and run another if you would like). 2. Attempt 64-Bit Installation on your library file Copy your library file to C : \ W i n d o w s \ S y s t e m 3 2 ; Register your library file as a 64-bit process; Pause to allow you to terminate the batch file at this point. 3. Undo 64-Bit Installation Reverse any registration of your library file as a 64-bit process; Delete your library file from C : \ W i n d o w s \ S y s t e m 3 2 ; Pause to allow you to terminate the batch file at this point (and run another if you would like). 4. Attempt 32-Bit Installation on your library file Copy your library file to C : \ W i n d o w s \ S y s t e m W O W 6 4 Register your library file as a 32-bit process; Pause to allow you to terminate the batch file at this point. 5. Delete original, unregistered copy of library file
edited Jun 11 at 8:53 answered Jun 9 at 13:25 Appreciative User 11 2

stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit

4/5

9/1/13

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

There is a difference in Windows 7. Logging on as Administrator does not give the same rights as when running a program as Administrator. Go to Start - All Programs - Accesories. Right click on the Command window and select "Run as administrator" Now register the dll normally via : regsrvr32 xxx.dll
answered Jun 11 at 9:57 Werner Spreeuwenberg 1

Not the answer you're looking for? Browse other questions tagged dll windows-7
64bit regsvr32 dllregistration or ask your own question.

stackoverflow.com/questions/4897685/how-do-i-register-a-dll-on-windows-7-64-bit

5/5

Você também pode gostar