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?

  • Are you copying it in as an Admin? Are you trying to replace a known Windows System file? Have you looked into using regsvr32 to register the DLL? – Ƭᴇcʜιᴇ007 Jun 16 '11 at 16:20

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:

  1. ren c:\windows\system32\filename.dll c:\windows\system32\filename.old
  2. 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.

Here is the full usage of regsvr32.

regsvr32 usage

  • This won't help with the "Access Denied" Johnes is getting, – Ben Voigt May 5 '12 at 0:18

To register a comm .dll or .ocx on Windows 7 32-bit, do the following:

  1. Copy .dll or .ocx to c:\windows\system32

  2. Type cmd in Run menu, it will search cmd.exe, right click and click Run as Administrator

  3. It will show a prompt at c:\windows\system32

  4. Type regsvr32 ocxname.ocx to register .ocx


    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.

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. – Synetech May 5 '12 at 0:15

There are usually two issues with regsvr32 on Windows 7:

  1. UAC
  2. 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.


C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\StrmExt_x64.dll

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.