Hey I tried adding a DLL file in Windows 7 by copying to system32 folder, but I couldn't as Access Was Denied. Actually there is an existing DLL file and I'm trying to replace it. How can I do this in Windows 7?
7 Answers
To register a dll, you open a command box as admin and then use regsvr32 /i <dll_name>
.
Tha said, your problem seems to be that you just can't copy the file. Again, open a command box as admin and do the following:
- ren c:\windows\system32\filename.dll c:\windows\system32\filename.old
- copy c:\randomlocation\filename.dll c:\windows\system32\filename.dll
If the file is in use, you should do this in safe mode, command prompt only. If you hose your system, you can delete the dll you copied, and rename the .old back to .dll.
-
1Gentle reminder: Look out for Windows File Protection - support.microsoft.com/kb/222193 :) Jun 16, 2011 at 16:30
Here is the full usage of regsvr32.
Unregister the existing DLL file first (with the /u
switch), and then register the DLL. This way, the un-registration routine will clean up the existing settings which often helps when re-registering.
-
That’s a good answer in regards to registering a DLL, but the question is about copying the file to
System32
.– SynetechMay 5, 2012 at 0:15
To register a comm .dll or .ocx on Windows 7 32-bit, do the following:
Copy .dll or .ocx to
c:\windows\system32
Type
cmd
in Run menu, it will searchcmd.exe
, right click and click Run as AdministratorIt will show a prompt at
c:\windows\system32
Type
regsvr32 ocxname.ocx
to register .ocxor
type
regsvr32 dllname.dll
to register .dll
the regsvr32 located in SysWow64 folder is for 32bit dll
It's a strange naming from microsoft: WOW64 means "windows [32bit] on windows 64bit" the one located in system32 is for 64bit dlls.
There are usually two issues with regsvr32 on Windows 7:
- UAC
- The fact that you may have a 64 Bit OS and the file dll you need to register is a 32 Bit one.
To get around the "Access Denied" problem, start the command line as admin, in the start menu type 'cmd.exe' and then right click the 'cmd.exe' entry and 'Run as Administrator'.
If the DLL is 32bit and in the 32Bit Windows directory, use the 32bit version of regsvr32 at c:\windows\sysWOW64\regsvr32.exe
If your Windows 7 is x64 and the DLL you want to register is x64 you may run regsvr32.exe
from C:\Windows\SysWOW64
.
Example:
C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\StrmExt_x64.dll