Categories Windows 7

Delete a Windows 7 Write Protected System File


You want to delete a system file but Windows prevents you from doing so despite your admin rank? Explanations in the rest of the article.

Each file on the hard drive belongs to one or more owners with a number of permissions and restrictions. System files are more protected: they are owned by the TrustedInstaller owner, which prevents you from removing them. Two steps will be sufficient to overcome this problem.

To do this, open the start Menu, enter CMD in the search field and do Entry.

The first step will be to take control of the file in question. The owner will no longer be the system but the user of the current session. In our example, I want to take control of one of the default wallpapers provided in Windows 7 from which it is impossible to remove. Copy the following line of code and paste it into the console:

takeown/f C:\Windows\Web\Wallpaper\Nature\img1.jpg

Make Entry to validate. You get the following message:

Capture d'écran - Prise de contrôle d'un fichier système via l'invité de commandes
Screenshot of screen — Control takeover of a system file via the command guest

For now it is still not possible to delete it. To do this, enter the following line of code in the console by changing “Benjamin” by your current session username (listed at the top of the Start menu):

cacls C:\Windows\Web\Wallpaper\Nature\img1.jpg/G Benjamin:F

Enter O and do Entry to the question Are you sure?

Capture d'écran - Autoriser la suppression d'un fichier système via l'invité de commandes
Screenshot — Allow deletion of a system file via command guest

You can now delete the file in question without any worries.

Before deleting a system file, make a backup copy, and be sure what you are doing! Is there any real interest in removing it?

11 comments

Leave a Reply

  • Gary

    Um that’s weird this trick, on my VAIO F11S1E laptop equipped with Windows 7 Home Premium the 2 controls work, but I don't need it on it.

    On the other hand, on my desktop I run on Windows 7 Pro and I have a hard drive to which an old Windows was installed (Windows 7 Ultimate) that I would like to recover the rights and the commands just doesn't exist:|

    C:\Users\Gary>cacls
    ‘cacls’ is not recognised as an internal command
    or external, an executable program or a command file.

    C:\Users\Gary>takeown
    ‘takeown’ is not recognised as an internal command
    or external, an executable program or a command file.

    • You need to specify the path of the file in the command for it to work. But it may not work if you're not in safe mode. For info, the tutorial was written under Windows 7 premium edition.

  • Steve DECES

    Good morning,
    I tried to take control of the files in Windows\System32\drivers, and every time, even if I indicate the file name, I have: The user currently logged in does not have the membership privileges on the file (although I am under my only account which is the admininstrator....who can help me?

    Thank you very much

  • alzahir

    thank you for the video. It’s very cool to share your knowledge with others
    less connoisseur. I tried it with the complete windows system instead of a file or dll.
    thank you very much for the twins benjamin.sknow that this is the first time I order my pc

  • Gaderr

    Extremely useful this tutorial!
    But I have a problem (finally 2):
    1. I would like to take control of a file but it has no extension, it itself is called Identity-H and has the type “file”:

    C:\WINDOWS\system32>takeown/f C:\Windows.old\Program Files (x86)\Adobe\Reader 1
    1.0\Resource\CMap\Identity-H
    Error: Invalid argument or option — “Files”.
    Enter “TAKEOWN/?” to display the syntax.

    How can I take control of it?

    2. Is it possible to take control of all files in the C:\Windows.old\ directory in one command?

    Thank you for your answer

  • Victim

    Good morning,
    My problem is even more serious?!
    In fact, a moron installed a system file that behaves like the administrator, and worse I can't do anything against the file, nor software, nor failed mode,it’s still there! What to do?

  • To make it work smoothly, I had to add a step:
    takeown/f E:\Windows/a/r
    which gives the rights to the administrator group
    Then
    takeown/f E:\Windows/r
    which gives the rights to the person who launches the order