Windows – How to display/change the owner of a file on Windows 7

command linepermissionswindows 7

Is there a way to display the owner of folders and files from the command line in Windoews 7 command prompt?

Can you change the owner of a folder or file to some "arbitrary" user which is not your own username?

I have some folders (and files) that are probably left over from an app that I have removed. If I try to view the contents of the folders I am that told I don't have permission to do so, even if I am running as an "Administrator".

I can "Take ownership" (I assume this will be successful but haven't tried it yet) of the folders (files), but if I need to revert the ownership to the previous owner, I need to know the username of the original owner, and I need to be able to "give ownership" to that user.

Is it possible to do this from the Windows command prompt (or if not, from a GUI-Tool)?

Best Answer

You can take ownership from the command line via the takeown command and via the Windows GUI.

You can view the owner of a file/folder by using the DIR with a /q parameter

You can view (and take) ownership via the Windows GUI by right clicking the object in Windows Explorer (file or folder), selecting Properties and then navigating to the Security tab. On the Security tab, click the Advanced button and on the subsequently displayed Advanced Security Settings dialog, navigate to the Owner tab.

Once you have taken ownership of a file/folder, Windows does not track the previous owner, so there is no way to revert back to the previous owner. Also, there is no concept of ownership or file permissions if you are working with a file system type that does not support these extended attributes such as FAT16, FAT32, exFAT, etc.

Related Question