Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What's the difference between takeown and icacls?  (Read 14983 times)

0 Members and 1 Guest are viewing this topic.

Windows User

    Topic Starter


    Greenhorn

    • Experience: Familiar
    • OS: Windows 10
    What's the difference between takeown and icacls?
    « on: March 20, 2022, 05:21:51 AM »
    I want to give my user-account the ownership-permissions for a directory.
    Found two commands both working, what exactly is the difference?
    Any pro and cons?
    takeown /r /f "C:\Program Files"
    icacls "C:\Program Files" /setowner "User" /t

    nil

    • Global Moderator


    • Intermediate
    • Thanked: 15
      • Experience: Experienced
      • OS: Linux variant
      Re: What's the difference between takeown and icacls?
      « Reply #1 on: March 20, 2022, 07:43:52 AM »
      To my knowledge, the main difference between takeown and icacls (Integrity Control Access Control LiSt) is that icacls is a more general administration tool that among other things can be used by an administrator to grant ownership of a file or directory to a specified user. Whereas takeown is a more specialized utility that does only that one specific thing, specifically for the user running the command.

      Both must be run by an administrator, and both commands shuld do the same thing if "User" is your username. The /t option for icacls is equivalent to the /r option for takeown (recursively grant ownership in subdirectories).

      So both commands with those options should be basically the same.
      Do not communicate by sharing memory; instead, share memory by communicating.

      --Effective Go

      Windows User

        Topic Starter


        Greenhorn

        • Experience: Familiar
        • OS: Windows 10
        Re: What's the difference between takeown and icacls?
        « Reply #2 on: March 21, 2022, 03:32:54 AM »
        Thanks for the help.
        I tought so,  /t option for icacls is equivalent to /r option for takeown.
        That's why im confused which command i should use and what will be the difference after all?

        Now i used both commands and monitored the terminal, booth seems to be taking ownership just fine but i noticed one option took longer than the other and also the commands visible in the terminal did look different from the other.

        Windows User

          Topic Starter


          Greenhorn

          • Experience: Familiar
          • OS: Windows 10
          Re: What's the difference between takeown and icacls?
          « Reply #3 on: March 21, 2022, 04:32:24 PM »
          Update:

          icacls and takeown are pretty much the same, the only difference i noticed is that takeown needs more time to take ownership than icacls does.

          Here to command that works perfectly for me:

          icacls "C:\Program Files (x86)" /grant user:F administrators:F /t
          icacls "C:\Program Files" /grant user:F administrators:F /t
          icacls "C:\Windows" /grant user:F administrators:F /t
          pause