In Windows Vista, occasionally you may need to take ownership of certain files that not belong to you, and then assign read, write, modify, traverse, or full control permissions to yourself. If you’re the administrator for the Vista system, then you can easily do it by following these steps.
1. In Windows Explorer window, locate the files or folders that you want to take ownership and grant access permissions.
2. Right click on the file or directory.
3. Click on “Properties” on the right click menu.
4. Click on “Security” tab.
5. Click on “Advanced” button at the bottom.

6. In Advanced Security Settings dialog window, click on “Owner” tab.
7. Here you will be able to see current owner (i.e. TrustedInstaller).

8. To take ownership of the object, click on the Edit button. Give permission to UAC. Then highlight the user name in the “Change owner to” box that you want to assign as the owner for the object. Click “OK” to finish the process.
9. Back in Advanced Security Settings window, you will see the current owner has changed to the user you just selected.
10. Click “OK” button to exit this window.
11. Click “OK” again to exit completely from the Properties window.
12. Repeat step 1 to 4 to open the object’s Properties window again.
13. Back in object’s Properties window, click on Edit button, and confirm the UAC elevation request.
14. Highlight the Administrators in the “Group or user names” box. If the user ID or group that you want to manage the permissions for the object doesn’t exist, click on “Add” button, and type in the user name or group name desired into the “Enter object names to select” box, and finish off by clicking on “OK”.
15. In the Permissions for Administrators box below (or any other user name or group name you chose), click on “Full Control” under the “Allow” column to assign full access rights control permissions to Administrators group.

16. Click “OK” twice when done.
You can do whatever you like to the files or directories processed as above.
It’s possible to take ownership and grant full control permissions from command line. Or you can also prepare a Windows shell batch script that easily perform the task by typing simple command.