How to overwrite system32 files in Windows 7?

9,415

Solution 1

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.

Solution 2

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.

Share:
9,415

Related videos on Youtube

matteo
Author by

matteo

Updated on September 18, 2022

Comments

  • matteo
    matteo over 1 year

    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)

  • matteo
    matteo over 12 years
    Do you mean mounting the virtual harddrive on the host? I forgot to mention my host is Ubuntu linux. Is there a way I can mount the virtual drive on ubuntu and delete files inside it? What is Windows 7 disk management?
  • Top__Hat
    Top__Hat over 12 years
    I don't know how to mount the virtual harddisk under Ubuntu. Windows 7 Disk Management is one of the system tools that lets you manage disks. A feature that was added in Windows Vista and above is to mount VHDs as a standard drive (new drive letter effectively). If I had known what your host OS was I would not have mentioned mounting the disk since I can not tell you how. Jaimg's answer is the better solution for you here.