Take ownership of files and folders in Windows

17 December 2025 - Thomas Damgaard

I often utilize Windows Performance Counters to log Windows performance metrics. By default, these counters log to C:\PerfLogs as the SYSTEM user. This results in the log files only being accessible by the SYSTEM account or Administrators group.

Here are commands to take ownership of those folders:

takeown /F "C:\PerfLogs" /R /D Y

You can verify the permissions using this command:

icacls "C:\PerfLogs"`

You should see your user listed with (F).

Alternative approach

Changing ownership from SYSTEM to your user may affect system monitoring logs. If you want to keep SYSTEM as owner but still have access, you can add your user to ACL without changing ownership:

 icacls "C:\PerfLogs" /grant YourUserName:F /T

(Skip takeown in that case.)

Filed under: acl, howto, ntfs, security, tips, windows

Back to article list