Windows/Folder Ownership windows

From EasyWebDNS
Jump to: navigation, search

Changing Folder Permissions and ownership

If you have installed a fresh copy of Windows Vista on a disk containing a previous version, You probably know you can not delete the folder located in c:\Windows.old\Windows (That contains your previous windows installation)

The reason is, The folder is still owned by the user of the old system, Even if the old user has the same name, and the same password, This folder has a different owner, One that is non existent.

But this is your computer, and you should be able to delete anything, But before deleting anything you will need to take ownership of the folder that you want to delete.

Even though you may have noticed, You can change the permissions / ACLs (Access Control Lists) of a folder from the properties windows GUI, but unfortunately, the effects are not recursive, Files and folders inside the folders will not have there owner changed.

Taking ownership of a folder recursively including all inner folders and files in Windows is done at the command line, You must start an elevated (Run as administraor) command prompt by clicking start => accessories => Right click Command prompt and select Run As Administrator.

Then you can execute one of the following 2 commands on the prompt

For Files:

takeown /f file_name /d y
icacls file_name /grant administrators:F



For Directories and sub-directories and files:

takeown /f directory_name /r /d y
icacls directory_name /grant administrators:F /t
Domain Search:
.COM$ 8.49
.NET$ 6.49
.ORG$ 7.49
.INFO$ 1.99
Compare Pricing
Cheap Domains
Personal tools