There are a few methods of doing this. Copying and running a .REG file is
possible, but it will not update the key either if the user is not a
Local Administrator on the computer.

The code that Kent gave you will work during logon for a user that is a
Local Administrator. However, as far as speed goes, there is no reason
to even check the key if you already KNOW that you want it set to
Lotus Notes, just write it every time.

Kents Code:

IF READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail","")<>""
$RC=WRITEVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail","","Lotus Notes","REG_SZ")
ENDIF


Revised Code:

IF INGROUP("\\" + @WKSTA + "\Administrators") = 2
; The line above is compatible with KiXtart v3.60 and will check if the user is a Local Admin.
$RC=WRITEVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail","","Lotus Notes","REG_SZ")
ELSE
$nul = MESSAGEBOX("You do not have sufficient rights to modify the Lotus Notes entry. ", "Check Local Admin Rights", 4144)
ENDIF


Notice how it works with FOUR sections
SUBKEY
"HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail"
ENTRY
"" ; Note, a blank value indicates the DEFAULT value
EXPRESSION
"Lotus Notes"
DATA TYPE
"REG_SZ"

Another thing you can do is what Jens was saying. On your own workstation
create a folder called SCRIPTS. Then under SCRIPTS create a folder
called 3 and one called 4 Copy KiXtart v3.6 and your other scripts into the
3 folder. Then download and extract KiXtart v4.21-RC2
http://www.scriptlogic.com/downloads/kix/kix2001_421rc2.zip
Then copy the executable files into the 4 folder C:\SCRIPTS\4
Then you can run Administrative scripts from the C:\SCRIPTS\4 folder against
remote machines (as long as you have Admin rights on all remote machines)
Thus you could locate all remote machines and run scripts on them that will
update data directly from your workstation. Then your users woudn't need to have
Admin rights for many of your scripts.

NOTE KiXtart v4.x can use HKLM for HKEY_LOCAL_MACHINE

COMNetView is a User Defined Function and can be located here
http://www.kixhelp.com/udfs/udf/000201.htm
or here (note also that Jens says the code only works for 2000/XP systems
but since you said
quote:
all systems are running Win2K pro
it should
not be an issue.
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000201


$comps=COMNetView()
for each $comp in $comps
$rc=writevalue('\\'+$comp+'\HKLM\SOFTWARE\Clients\Mail','','Lotus Notes','REG_SZ')
if @ERROR
? 'Error '+@ERROR+' = '+@SERROR+' on comp '+$comp
endif
next

Function COMNetView(optional $domain)
Dim $list[0], $objDomain, $counter, $seed, $objComputername
Dim $filter[0]

; this function seems to only work on Windows 2000/XP computers
; even in a Windows NT 4.0 domain
if val(@INWIN)<>1 or val(@DOS)<5
exit 196
endif

$domain = trim($domain)
if $domain=''
$domain=@DOMAIN
endif

$counter = 0
$seed = 100
$filter[0]='Computer'

$objDomain = GetObject('WinNT://' + $domain + ',domain')
if @ERROR
exit @ERROR
endif
$objDomain.Filter=$filter
if @ERROR
exit @ERROR
endif
For Each $objComputername In $objDomain
$list[$counter] = $objComputername.Name
$counter = $counter + 1
if $counter > ubound($list)
redim preserve $list[$seed+ubound($list)]
endif
Next

if $counter > 0
Redim Preserve $list[$counter- 1]
endif
$objDomain = 0

$COMNetView = $list
EndFunction


Now, one thing about the code from Jens, it will run on ANY system where it locates the system
and you have Admin Rights, including SERVERS so you might want to modify the code or
create some list of SERVERS, then go back and repairs what it did. It would be better to
NOT modify anything on a Server if you don't want it that way in the first place though.

If you try the LOGON script using v3.60 of KiXtart you will notice that even if you add the
method to SHELL out and run the .REG file if you are not an Admin, you won't be able to update that key.

Oh... FYI,
If you have Admin rights on your 2000 Active Directory, you can also accomplish this with GPO as well.

[ 08. May 2003, 22:48: Message edited by: NTDOC ]