Page 1 of 1 1
Topic Options
#67998 - 2002-07-10 10:33 AM Is It possible to create a new subkey.
futte Offline
Fresh Scripter

Registered: 2002-07-02
Posts: 49
Loc: Denmark
Hey

Is It possible to create a new subkey, in the reg. database ??

Thanks

Top
#67999 - 2002-07-10 10:40 AM Re: Is It possible to create a new subkey.
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Yes,

Please give an example of the name and location of the KEY/VALUE you want to create.

Les also shows this in the FAQ section of this board I think.

Top
#68000 - 2002-07-10 10:46 AM Re: Is It possible to create a new subkey.
futte Offline
Fresh Scripter

Registered: 2002-07-02
Posts: 49
Loc: Denmark
Hey

What i have done so far is :

writevalue ( "HKEY_LOCAL_MACHINE\Software\CompanyName" , "" , "0" , "REG_SZ" )

But i get an error code 2, and i think it's because "ComputerName" not exist in the "HKEY_LOCAL_MACHINE\Software"

I've tried to create the "CompanyName" via the regedit-module and thereafter use the above writewalue, and that works fine.

But i have to create it first via kix. !!

Thanks [Smile]

Top
#68001 - 2002-07-10 10:58 AM Re: Is It possible to create a new subkey.
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
From the docs...
quote:
AddKey( )

Action: Adds the specified subkey to the registry.

Syntax: ADDKEY ("subkey")

Parameters: Subkey

A string that specifies the name of the subkey you want to add to the registry.

Returns: 0 Subkey added
Error code Function failed


See Also: DelKey( ), DelTree( ), ReadType( ), ReadValue( ), WriteValue( )

Example: $ReturnCode = AddKey("HKEY_CURRENT_USER\EZReg")
If $ReturnCode = 0
? "Key added...."
Endif


Hope this helps.
_________________________
================================================
Breaker


Top
#68002 - 2002-07-10 01:54 PM Re: Is It possible to create a new subkey.
futte Offline
Fresh Scripter

Registered: 2002-07-02
Posts: 49
Loc: Denmark
Hey

Yes that works !!

thanks

Top
#68003 - 2002-07-10 02:52 PM Re: Is It possible to create a new subkey.
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
look up the UDF :
RegWrite()
_________________________
How to ask questions the smart way <-----------> Before you ask

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

Generated in 0.056 seconds in which 0.026 seconds were spent on a total of 11 queries. Zlib compression enabled.

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