Ktodi,
I'm not sure if that is what Michael is really asking or not.
Regardless, all these methods require that the user logging on has Administrator rights in order to update that key in the Registry.
I've modified your code a little to be compliant with the NoVarInStrings option of KiXtart.
Code:
Break On
Dim $RC,$adsComputer,$setInfo
$RC=SetOption('Explicit','On')
$RC=SetOption('NoVarsInStrings','On')
$adsComputer = GetObject("WinNT://" + @Domain + "/" + @WKSTA + "/LanmanServer,FileService")
$adsComputer.Description = Trim(@FULLNAME)
$setInfo = $adsComputer.SetInfo
But if that is the way you're going to do it, why waste network time looking for the system. Simply write the value each time in the Registry, it will be much faster. You an write it faster then you can compare and write so might as well just write it.
Code:
Break On
Dim $RC,$setInfo
$RC=SetOption('Explicit','On')
$RC=SetOption('NoVarsInStrings','On')
$setInfo = WriteValue('HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters', 'srvcomment',@FULLNAME,'REG_SZ')