Page 1 of 1 1
Topic Options
#43364 - 2003-07-25 03:50 PM Append to registry
jhansenjr Offline
Fresh Scripter

Registered: 2002-08-31
Posts: 37
Loc: New Jersey
Is there a way to append to a registry key? I'm would like to be able to append the "path" key in the registry. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path

Thanks

Top
#43365 - 2003-07-25 03:51 PM Re: Append to registry
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Read the registry value, add the data, write to the registry key. However, writing to HKEY_LOCAL_MACHINE requires administrative privileges under Windows NT/2000/XP/2003
_________________________
There are two types of vessels, submarines and targets.

Top
#43366 - 2003-07-25 03:53 PM Re: Append to registry
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
KiX has the intrinsic SET, SETL, SETM commands that do that without having to hack the registry.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#43367 - 2003-07-25 04:08 PM Re: Append to registry
jhansenjr Offline
Fresh Scripter

Registered: 2002-08-31
Posts: 37
Loc: New Jersey
I know how to read and write to the regitry but I'm not familiar with adding to an existing key. Is there a command for this? Also, doesn't the set, setl, and setm replace the whole value?
Top
#43368 - 2003-07-25 04:12 PM Re: Append to registry
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
quote:
I know how to read and write to the regitry but...
You are contradicting yourself. Appending is nothing more than reading, adding to the string, and writing. RTFM on SET, or better yet, take it out for a test drive.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#43369 - 2003-07-25 04:21 PM Re: Append to registry
jhansenjr Offline
Fresh Scripter

Registered: 2002-08-31
Posts: 37
Loc: New Jersey
I have tried the set commands prior to posting and have had no luck. When I used these commands I replaced the whole path. I need to do this for local machine not current user. Basically all I need to know is how to add to the value that you have read in from the resitry?
Top
#43370 - 2003-07-25 04:23 PM Re: Append to registry
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Which is what I wrote too [Confused]
code:
; prototype code
$data=readvalue($key,$value)
$data=$data+'more data'
$rc=writevalue($ket,$value,$data,$format)

_________________________
There are two types of vessels, submarines and targets.

Top
#43371 - 2003-07-25 04:28 PM Re: Append to registry
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Also
code:
SETM "PATH=%PATH%;c:\whatever"

would append an additional path to the existing path variable, IIRC.

[ 25. July 2003, 16:31: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#43372 - 2003-07-25 07:47 PM Re: Append to registry
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Exactly, just how you would do it in DOS. [Wink]
Well, unless you DID want to replace it. [Confused]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#43373 - 2003-07-28 03:40 PM Re: Append to registry
jhansenjr Offline
Fresh Scripter

Registered: 2002-08-31
Posts: 37
Loc: New Jersey
Thanks for your help.
Top
#43374 - 2003-07-28 06:40 PM Re: Append to registry
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
11 posts later... [Frown]

Looking in the UDF lib:
Topic: Add2Path() - add a directory to the path
Topic: ExistOnPath() - checks if file exists anywhere in the %path%
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#43375 - 2003-07-28 06:50 PM Re: Append to registry
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Les, that was not in the specs [Wink] The original specs were appending data to existing data in a registry value, incidentally being the %PATH% value. [Wink]
_________________________
There are two types of vessels, submarines and targets.

Top
#43376 - 2003-07-28 06:55 PM Re: Append to registry
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I realize that but the UDF provides a good example of appending. That and junior knew the req better than us and could have found the answer in the UDF library, saving korg bandwidth.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.038 seconds in which 0.018 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