2

I have Windows 7 64bit installed on a virtual box (the fact it is a virtual box shouldn't be relevant). I need to overwrite /Windows/System32/d3d9.dll but the system won't let me.

I've read the same "solution" on a lot of forums, except nobody mentions it doesn't work at all:

takeown -f filename
cacls filename /G username:F

which both succeed. But then, when I try to delete the file, I still get access denied. And I am doing all this in safe mode AND within CMD being run as administrator.

What is the working way to delete the file so I can replace it? (or directly overwrite it)

Mithical
  • 321
matteo
  • 4,559

2 Answers2

5

The only sure way to delete/replace the file that is used by a running system is to do it from outside of it. E.g. boot off Windows 7 Install CD in Recovery Mode, open command prompt and proceed with the commands you quoted in your question. The DLL won't be in use, and you'll be able to delete it.

haimg
  • 23,153
  • 17
  • 83
  • 117
3

Because you are running in a Virtual Box environment it is very relevant because you can power down the VM, mount the underlying virtual harddrive in Windows 7 disk management and then replace the file you need as you would any other file.

Top__Hat
  • 246