You need both commands because they perform different functions:
-
takeown
: This command changes the ownership of the folder to your user account.
Without it, you may not have the right to modify the folder's permissions, especially if it's owned by another account. -
icacls /grant:r
: This command assigns specific permissions (like full control) to your user account.
Ownership alone doesn't automatically grant full permissions, so you need this step to ensure the correct access rights are set.
Both are needed to regain full control of the folder.