Are you Admin on a Windows box but still not able to inspect a folder’s content? Getting an “access denied error”? In this post, I’ll show you how to give yourself full access to another user’s directory via the command line using native Windows tools: takeown and icacls.
By default, users profile folders (like C:\Users\SomeUser) are protected by NTFS permissions. Even if you’re an Administrator, you don’t get automatic access. If you try to inspect a folder’s content you rely on the User Account Control (UAC) to request it.
This is good for security, but it can get in the way when you’re trying to automate things or need persistent access without additional clicks, like when working in a command line environment.
Fortunately for us, there’s a way to bypass that UI prompt even when working with command line tools.
Here’s how that can be accomplished either from GUI or a command line session.
From a RDP session
If you are connected via RDP, you will open a command prompt as Administrator. Then you will take file ownership and assign yourself proper permissions as follows:
Take file Ownership (Optional)
takeown /f "C:\Users\OtherUser" /r /d y
