Note: These commands will work on Windows 7 and 8.
Step 1. Open an elevated administrator command prompt and run this command on the desired file or folder:
takeown /F file_or_folder
Step 2. Take ownership of the file or folder.
c:>takeown /R /F x:\windows\csc SUCCESS: The file (or folder): "c:\windows\csc\" now owned by user "domain\user".