Jump to content

Help with setting permissions on a reg key ?


Recommended Posts

This is something I posted in the Windows XP forum:

For IE - how do I get "text size" setting to stay?

I thought I'd also ask here, because this is really more of an unattended thing, anyway. Here is my problem with setting permissions on a reg key -- I understand the general idea. For example, let's say that I have all of the following files in WINNT:

regini.exe

example.bat

example.ini

I create a batch file that uses regini to call an ini file:

example.bat

c:\WINNT\regini.exe c:\WINNT\example.ini

example.ini

\Registry\Machine\Software [1 5 8]

In that example, on the registry key HKEY_LOCAL_MACHINE\Software, it sets the permissions as such:

Administrators group -- Full Control

Creator/Owner group -- Full Control

Everyone group -- Read permission

Here is my problem. According to the following KB article:

Use a Script to Change Registry Permissions from the Command Line

the different registry Hives are translated as follows:

HKEY_LOCAL_MACHINE = \Registry\Machine

HKEY_USERS = \Registry\Users

HKEY_CURRENT_USER = \Registry\User\User_SID (where User_SID is the current user's security identifier)

But the main point of this exercise for me is an HKCU registry key:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\International\Scripts\3

Doesn't the SID change with every install? If so, how am I supposed to set permissions on the key in my install? Unless the SID is the same at the cmdlines.txt stage.... I don't know. :no:

Link to comment
Share on other sites


The SID (Security ID) change with every install (which is also why you can't "straight" clone NT/2k/xp/2k3 boxes on a network, they have to have their own - newsid/sysprep takes care of it...)

But - you could try to dynamically get the user's SID and use that instead of a hardcoded one. You could use GetSID (my microsoft).

link to GetSID:

http://www.microsoft.com/windows2000/techi...ng/getsid-o.asp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...