Is it possible to change the owner of folder through the Registry in Windows?

0

Can I change the owner of folder through the Windows Registry? If yes, where are the settings for the folder on the Desktop?

Kirill

Posted 2017-07-29T19:49:35.440

Reputation: 41

Question was closed 2017-07-30T11:19:41.980

9The permissions and ownership has nothing to do with the registry. Why don't you just take ownership of the file or folder through the normal means? – Ramhound – 2017-07-29T22:40:35.900

2

My first inclination was "no". Security settings are part of the filesystem. However, just what is stored in those bits of the filesystem? Do the files actually map to a SID? And, can that SID be matched to a different user by modifying the registry? (Possible resource?) (Or groups?) This may be a much less direct route for modifying permissions, but would be be technically workable?

– TOOGAM – 2017-07-30T00:50:28.267

1@TOOGAM Yes, that could work. Canonical user (and group) SIDs (Security IDentifiers) are stored in the SAM (Security Account Manager), which is a registry hive. The physical file for the SAM is typically C:\Windows\System32\config\SAM (no extension), and while the machine is running it is mounted under HKLM\SAM, and also under HKLM\SECURITY (that is, HKLM\SAM\SAM and HKLM\SECURITY\SAM are the same data). I strongly advise against manually attempting to edit the SAM, though; it's not organized like other registry data and is not intended to be human-readable at all. – CBHacking – 2017-07-30T01:00:28.147

@DavidPostill What is unclear about this question? Do we not think the question is asking about ownership of the Desktop folder? – I say Reinstate Monica – 2017-07-30T12:06:48.940

@Twisty "where are the settings for the folder on the Desktop?" There can be many folders on the desktop ... in any case this looks like an XY problem

– DavidPostill – 2017-07-30T12:14:22.587

@DavidPostill I see your point. The asker doesn't appear to be a native English speaker and I read the question without taking the grammar too seriously. The grammar is a problem however. – I say Reinstate Monica – 2017-07-30T12:19:14.627

@Twisty FWIW Journeyman Geek also agrees https://chat.stackexchange.com/transcript/message/39114917#39114917

– DavidPostill – 2017-07-30T12:19:44.663

@Twisty It's also not a question we want to be a HNQ :) – DavidPostill – 2017-07-30T12:21:52.693

@DavidPostill: I just came here from a side bar. So many people up-voted the currently-leading answer, it looks like this may now be on the HNQ list. – TOOGAM – 2017-07-30T15:59:46.633

Answers

16

No, you cannot. Security settings for files and folders are not stored in the Registry. They're part of the NTFS filesystem. You can use the command prompt commands icacls and takeown though...

LPChip

Posted 2017-07-29T19:49:35.440

Reputation: 42 190

4

No, because owner information is stored in the filesystem, not the Registry.

According to the TechNet article How Owners Are Assigned and Changed:

When an [NTFS] object is created, the SID stored in the [user's access token] Owner field is copied to the security descriptor's Owner field.

This security descriptor is stored in the $SDS data stream of the $SECURE file, which is one of 11 NTFS metafiles stored in the root of the volume.

Since NTFS Owner information is stored in the filesystem it's not possible (and simply doesn't make sense) to use the Registry to change a file's Owner.

As already mentioned by @LPChip, there are command-line programs that can be used to take ownership of a file or folder. You can also right-click the object, view its properties, then on the Security tab use the Advanced button to access the Owner tab. Here you can view the current owner or change it if you have the necessary permissions.

I say Reinstate Monica

Posted 2017-07-29T19:49:35.440

Reputation: 21 477