Page 1 of 1 1
Topic Options
#37892 - 2003-03-13 04:01 PM SaveKey Errors
chapel Offline
Lurker

Registered: 2003-01-31
Posts: 2
Loc: Washington, D.C.
Hi-

I have Kixtart running as a login script.

This particular code is designed to export a key to a file, create a new key, and load the information into the new key.

I've attached a very short section of the code.

code:
$profiles = 'HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles'
$defaultid = ReadValue("$profiles", "defaultprofile")

$tmpfile='%userprofile%\profile.tmp'
$ReturnCode = SaveKey('$profiles\$defaultid', $tmpfile)
? $ReturnCode
$ReturnCode=AddKey('$profiles\backup')
? $ReturnCode
$ReturnCode=LoadKey('$profiles\backup', $tmpfile)
? $ReturnCode

The returncodes are as follows, in order:
1314
0
1314

the users on the machine MUST only have user privelages. I use ScriptLogic to execute the script.

1314 means there are insufficient rights to the registry. I'm a bit confused as to why it lets me add a key to the users hive file but not save the info from the same hive file (different key) or load into the key that i create.

Anyone have ideas regarding maybe an alternate way of doing it, or doing a "runas" type deal as an admin, while maintaining the CURRENT USER as the actual user's hive?

Thanks!

[ 13. March 2003, 16:04: Message edited by: chapel ]

Top
#37893 - 2003-03-13 04:19 PM Re: SaveKey Errors
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
First of all, please read the FAQ Forum under LOADKEY - Why doesn't it work? .

Secondly, as documented in the KiXtart Manual
quote:
On Windows NT, using LOADKEY requires Backup and Restore privileges
. Regular users do not have this privilege.
_________________________
There are two types of vessels, submarines and targets.

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 696 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.048 seconds in which 0.023 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