Taking Ownership of a File Using the Command Prompt
Symptom/Sign of Problem
Access denied errors are showing up when you try to modify a system file on Vista or 7 machines.
Cause
The default permissions for most system files (mostly Vista) is read only for System and Administrators and the Owner is “TrustedInstaller”
Fix Steps:
Step 1: Take Ownership First
1. Open an elevated command prompt and type the following:
a. Takeown /a /f <filename>
b. /a = give Administrators ownership, /f = file or folder name
Step 1: Grant permissions to the Administrators group
1. Open an elevated command prompt and type the following:
a. Cacls <filename or folder> /e /g Administrators:F
b. /e = edit the ACL, /g = grant access, :F = full control
Note: The Takeown.exe executable only exists in Vista and 7. By default, Administrators in XP will have full control of system files.