Page 1 of 1 1
Topic Options
#62344 - 2002-01-23 07:00 AM Writing to the registry
Anonymous
Unregistered


Hi,

I'm trying write to a file and write a key to the registry, checking for the key at subsequent logons to ensure that the write is only performed once.
My code looks like this (alright I stole it)
---------------------------------------------
$key = "HKEY_LOCAL_MACHINE\Software\Fowles\customdic"
$ReturnCode = ExistKey ("$key")
If $ReturnCode=0
goto EndCommon
else
call "wordic.kix"
$ReturnCode = AddKey( "$key" )
Endif
---------------------------------------------

Anyone able to see where I am going wrong?

Thanks

Top
#62345 - 2002-01-23 10:18 AM Re: Writing to the registry
Jeroen Offline
Starting to like KiXtart

Registered: 2001-08-16
Posts: 180
Loc: Netherlands
Hi,

Question; does the key Fowles already exist at the point your performing AddKey? If not, try this and see what happens:

code:

$key = "HKEY_LOCAL_MACHINE\Software\Fowles"
$ReturnCode = ExistKey ("$key\customdic")
If $ReturnCode=0
goto EndCommon
else
call "wordic.kix"
$ReturnCode = AddKey( "$key" )
$ReturnCode = AddKey( "$Key\customdic" )
Endif

_________________________
Regards, Jeroen. There are two ways to write error-free programs. Only the third one works.

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
1 registered (Allen) and 957 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.05 seconds in which 0.024 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