Page 1 of 1 1
Topic Options
#73985 - 2003-03-12 07:48 PM LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
I am getting an Error 19 using LoadKey on Kix 4.12 under Windows XP SP-1

Here's my code:

code:
 
IF (@inwin = 1)
$profilelocation = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
ELSE
$profilelocation = "HKEY_CURRENT_USER\Software\Microsoft\Windows Messaging Subsystem\Profiles"
ENDIF

$tmpfile=%TEMP%+'\OLProf.dat'

$save=$profilelocation+"\"+@UserID
$Load=$profilelocation+"\"+@UserID+"X"
SaveKey("$Save", "$tmpfile")
AddKey("$Load")
sleep 3
LoadKey("$Load", "$tmpfile") ; This line fails!
? @Error
? @Serror

The Return:
code:
 19
The media is write protected.

Any ideas?

(I can't use WriteValue()...I need to backup a section of the registry.)

Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73986 - 2003-03-12 09:47 PM Re: LoadKey Error 19
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
first question, are you doing this during logon?
if not, have you e-mail client open?
_________________________
!

download KiXnet

Top
#73987 - 2003-03-12 10:02 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Not performing during login at this time. This is a test script for login testing once it works.

Outlook was NOT open at the time.

I can not seem to restore (LOADKEY) any file using SAVEKEY under Windows XP. Have not tested under other OSes.

This stumps me!!!

Does anyone have similar code working?
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73988 - 2003-03-12 10:06 PM Re: LoadKey Error 19
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
no XP machines to test on, sorry.
_________________________
!

download KiXnet

Top
#73989 - 2003-03-12 10:07 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
This looks like a bug to me...

Need to review more...
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73990 - 2003-03-12 10:27 PM Re: LoadKey Error 19
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
No bug. I believe you're encountering a rights issue. It is well possible that you might require 'Backup & Restore' permissions. What's the suersrights? Does it happen for an administrative account, too?
_________________________
There are two types of vessels, submarines and targets.

Top
#73991 - 2003-03-12 10:29 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Admin rights on the PC.

Also, performing the operation manually to adjust the registry works fine.
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73992 - 2003-03-12 10:50 PM Re: LoadKey Error 19
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about if you do the load to same place where you saved it from?
_________________________
!

download KiXnet

Top
#73993 - 2003-03-12 11:01 PM Re: LoadKey Error 19
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Just for kix, use regedt32 and view the security settings on the key...

I've encountered registry paths where, even as an Admin, I did not have Write access.

I've modified your code slightly and tested it on my 2K workstation at work and it works as expected. I'll try it at home on XP and post the results this evening.

The mods I made are because I don't have Outlook installed.. I've modified the Load & Save definitions as follows:
code:
 
$save = $profilelocation + "\Windows"
$Load = $profilelocation + "\" + @UserID

This exports the Windows key to a file, then imports it to a key that uses my User ID.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#73994 - 2003-03-13 05:11 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Save and Load to same location = same problem.

I've given up on this issue, and found a different approach to my problem. I believe there is still some issue outstanding. Not sure if it is an OS, Key Length, Security, or other issue.

Thanks for the assistance.
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73995 - 2003-03-13 05:13 PM Re: LoadKey Error 19
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Did you read the following in the KiXtart Manual?

quote:
On Windows NT, using LOADKEY requires Backup and Restore privileges
_________________________
There are two types of vessels, submarines and targets.

Top
#73996 - 2003-03-13 08:36 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
Yes. Did you read my message stating I was an Admin?

I confirmed those rights as one of my first steps. Including local policy settings.

I can write, read, merge all the keys manually. Only using those functions does it not work, using Kix 4.12, on my test system, using those test keys, under any account.
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73997 - 2003-03-13 08:46 PM Re: LoadKey Error 19
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Admin privileges do not neccessarily imply 'Backup and Restore' privileges.
_________________________
There are two types of vessels, submarines and targets.

Top
#73998 - 2003-03-13 09:09 PM Re: LoadKey Error 19
Crazy Eddie Offline
Starting to like KiXtart

Registered: 2002-11-20
Posts: 105
Loc: Sacramento, CA USA
I confirmed the rights in the local security policy too. I did RTM. [Smile]

Thanks,
Ed
_________________________
{Insert your favorite Witty Tag Line here}

Top
#73999 - 2003-03-13 09:10 PM Re: LoadKey Error 19
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
RTM?
Reach The Mother?
_________________________
!

download KiXnet

Top
#74000 - 2003-03-13 09:13 PM Re: LoadKey Error 19
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Jooel: Imagine a honking big F between the 'T' and the 'M' [Big Grin]
_________________________
There are two types of vessels, submarines and targets.

Top
#74001 - 2003-03-15 03:33 AM Re: LoadKey Error 19
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Used modified code below on my XP Pro machine and it worked fine. Moved the test value from the UserID key to the UserIDX key.

code:
 
$profilelocation = "HKEY_CURRENT_USER\test1\test2"

$tmpfile=%TEMP%+'\OLProf.dat'

$save=$profilelocation+"\"+@UserID
$Load=$profilelocation+"\"+@UserID+"X"
SaveKey("$Save", "$tmpfile")
AddKey("$Load")
sleep 3
LoadKey("$Load", "$tmpfile") ; This line fails!
? @Error
? @Serror


Top
Page 1 of 1 1


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

Who's Online
0 registered and 857 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.137 seconds in which 0.098 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