Page 1 of 1 1
Topic Options
#211737 - 2016-06-30 06:21 PM Creating an empty registry key
Knoxer Offline
Just in Town

Registered: 2016-06-30
Posts: 2
Loc: USA
Hi,

I'm trying to do something seemingly easy, but it's proving quite difficult. I need to write out a registry key with no underlying values.

What I've tried so far:

 Code:
WriteValue("HKEY_CURRENT_USER\Software\Company\Title\Version\Security","","","REG_SZ")

Result:
Creates the empty key, but the Default value is not "Value Not Set" as it needs to be -- it has a blank value, which is different.

 Code:
WriteValue("HKEY_CURRENT_USER\Software\Company\Title\Version\Security","",,"REG_SZ")

Result:
Fails.

 Code:
WriteValue("HKEY_CURRENT_USER\Software\Company\Title\Version\Security")

Result:
Fails.

Is there a way to create just the "Security" key and keep the default value == (value not set)?

Thanks!

Top
#211738 - 2016-06-30 06:30 PM Re: Creating an empty registry key [Re: Knoxer]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Um, AddKey()?? This just adds a key to the registry.

Welcome to KORG!

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

Top
#211739 - 2016-06-30 06:38 PM Re: Creating an empty registry key [Re: Glenn Barnas]
Knoxer Offline
Just in Town

Registered: 2016-06-30
Posts: 2
Loc: USA
Brilliant! I didn't even know that function existed. All my Google searches were pointing me towards WriteValue. Thank you so very much, Glenn.
Top
#211740 - 2016-06-30 08:49 PM Re: Creating an empty registry key [Re: Knoxer]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
OK - I'll say it.. "RTFM!!" \:D

The friendly manual is available in several formats on the home page here, along with the online command reference. (after 21 years with Kix, I still hit the online reference regularly!) The command reference is pretty thorough, but doesn't deal with some of the variable and COM explanations that are covered in the manual, so it would be good to review that as well.

That function isn't too widely used compared to WriteValue, so not too surprising that Google fell short.

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

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 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.05 seconds in which 0.021 seconds were spent on a total of 13 queries. Zlib compression enabled.

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