Vista: How To Take Ownership of a System File

Posted March 15, 2007 by Rob Rogers in Microsoft Vista

If you are trying to tweak or modify your Vista system, you will run into a barrier when it comes to replacing or changing system files. You can take ownership of the file and then grant your username full control of the file. After you have made your changes and/or modifications, you can then remove the permissions.

First you will need to access an elevated command prompt, to do this:

1. Click the Start button.

2. Click All Programs.

3. Go into Accessories.

4. Right-click on Command Prompt.

5. Select Run as administrator.

6. When the UAC Prompt appears, click Continue.

Once you have your elevated command prompt, follow these steps:

For our example, we are going to use the Bubbles screensaver file (Bubbles.scr)

1. At the command prompt, input takeown /f filepath (takeown /f c:\windows\system32\Bubbles.scr).

2. Press Enter on the keyboard.

3. A message will be displayed that this completed successfully.

4. Now input icacls filepath /grant yourusername:f (icacls c:\windows\system32\Bubbles.scr /grant shamanstears:f).

5. A message will be displayed that this completed successfully.

You will now be able to modify or replace the file. When you are done, simply remove the permissions to keep the file secure.


About Rob Rogers

Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
View more articles by Rob Rogers

The Conversation

Follow the reactions below and share your own thoughts.

  • Serizzim

    Thank you a lot, solved my issue. And yes, it does work on whole folders.

  • Hassan

    Thanks that works.

  • ray

    it doenst work with system32

    • Uwe

      do you have an idea to install open office under Vista?
      Someone told me that I have to rename the file mscoree.dll in folder windows32.
      But that doesn´t work with the idea above.


  • Tim

    it won’t accept my username

  • Trevv

    It won’t accept username
    Invalid parameter “UserName:F”

  • Uwe

    that doesn´t work for the file mscoree.dll in folder windows32


  • Mike

    Thank you so much.

    I was getting to the point of dispair with not being granted access to the root of my F: drive.

    Worked perfectly

  • calv7n

    Hi, thanks very much for the tip. I’ve been able to rename my mscoree.dll folder in system 32 (but it didn’t solve my problem unfortunately!). I’d like to remove the premissions now, but I don’t how to do it. Can anybody help? Thank you in advance

  • Leito

    Thanks for that tip, it works well on my Vista and I’m glad for that (:
    But can you give us the commande to remove permissions?

    • Leito

      I just found how to take off permissions :

      icacls filepath /deny yourusername:f (=take off the ‘grant’)

  • Anonymous

    I tried the above instructions, but the response I got when trying to get it to “grant” was the following:

    user name: No mapping between accounts names and security ID’s was done.
    Successfully processed 0 files; Failed processing 1 files.

    What does that mean and how can I correct this?

  • Anonymous

    i tried to do it but all it said after i`ve typed the file name in to the window it said cant associate the file go to set association control panel and select , etc

  • Chuck

    Everyone who offers this guidance seems to ignore a really fundamental question. Is “takeown” permanent? What about restoring file ownership to its original state when you’re done modifying, especially for system files? How do you do that?

    • Anonymous

      First use icacls to back up the perms. Then perform the work. Use icacls to restore the perms when you’re finished

  • Stephanie

    what happens if you can’t locate you file path? You can trace it through Start then Computer then C: Drive then Program Files then Common Files then Microsoft Shared then etc…
    But when my screen says: takeown /f c:programfilescommonfilesmicrosoftshared……….
    it comes up with “path not found” What am I doing wrong?

  • Anonymous

    Windows says there is no such command “icalcs”

    But the previous command (takeown /f) worked.


  • Name

    @Furry321 icalcs should be spelled icacls.

  • GrannyGeek

    I was able to add this permission and change my filename. But I don’t know how to remove the permission again…

  • Patrick

    when i open command promnt it dosent let me go to any other fine other that the files in system32 i want to find a file in program files

  • Lena0581

    didn´t work for mscoree.dll. how do i remove the permissions? help please!

  • Kevin

    What if you cant load your vista o/s, and cradle/dock the hdd from that pc to a new, operating pc running win 7? how can I gain control over files then? im told access denied, insufficient rights or something similar, indicating user protection enabled and unable to access even the txt files.

  • C

    My username is invalid in Windows 8 Pro w/ Media…
    Help. Do I need to type down my email also?

  • Dave Thijssen

    Thanks for this.

    I was running into a problem deleting a read-only system file from my NAS, although I was able to rename it without any problems. This ensured me the file was not in use.

    Taking ownership trough the GUI (Advanced Security) didn’t work. But after executing the commands above in an elevated Command Prompt I could finally delete the file.

    By the way, this was not Vista, but Windows Server 2008 R2.