Page 1 of 1 1
Topic Options
#10110 - 2001-07-04 08:42 AM savekey vs registry vs permissions
Anonymous
Unregistered


Am trying to write a kix script that does several registry modifications (in NT 4). The problem I am running into is that the script works for an administrator user but it bombs for an ordinary user. Am getting an insuffecient permission error.

Is there any way to give an ordinary user admin privs on the fly? Thought about using SU.exe but the key I need to modify is HKCU. When I invoke SU, I get a totally different HKCU. Need to save the user's old Outlook profile to a file before I delete it and install the MS new exchange profile. Plus am setting various Outlook defaults.

Saw an idea that may work:
1. $variable = @USERID
2. SU
3. savekey ("HKU\$variable\software\.....

Thoughts?

Alternative:
Can some tell me the syntax for invoking SU so it gives admin rights and retains the user's HKCU hive?

Option three:
Also anyone hear of a small exe the will modify the user's security token on the fly?

I find this problem real weird as regedit will do all the stuff I wnat to do manually without the weird permission problems.

Appreciate your/any ideas/thoughts on this problem. I'm at a real brick wall on this one.

Grant.

Top
#10111 - 2001-07-06 12:36 AM Re: savekey vs registry vs permissions
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi Grant,

Welcome to the coolest bb around.

Per default, 'simple' users have read AND write access to keys in HKCU. This is were all personal stuff of the user is stored, like office settings.

So if you want to change these you should have no problems with permissions. (Unless you have taken those rights away from your users?)

_________________________
The Code is out there

Top
#10112 - 2001-07-07 10:44 PM Re: savekey vs registry vs permissions
Anonymous
Unregistered


Ordinarily that is the case. Unfortunatly the SaveKey function requires the user to have backup & restore rights[1]. Normal users, at work and on my home system, do not have these rights. So whenever I try to run savekey as a normal user I get an error 1314 (no permision).

This really bugs me as I can do what I need to do when I run regedit but I cannot seem to find a way to script this.

1. As per the KIX 3.x manual (as a note in the .DOC manual - no note in the on-line manual)

Top
#10113 - 2001-07-08 12:24 AM Re: savekey vs registry vs permissions
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
will the writevalue() command do the job?
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 676 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.029 seconds in which 0.012 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org