Using the environment variable depends on when you're going to use it. Are you going to use it during the logon script or after?

From the manual
Quote:

SetL

Action: Sets environment variables in the local environment that you see when you start a program from within a KiXtart script.

Syntax: SETL "variable=string"

Remarks: This command does not affect the current environment. If you start KiXtart from a batch file, any commands in the batch file that are run after KiXtart exits do not see changes made by the SET or SETL commands. If you want to run batch files or programs that depend on settings set by KiXtart, start them from KiXtart using SHELL or RUN.
SETL sets the value of @ERROR.

See Also: Set, SetM





Here is some example code to allow you to use the environment AFTER the logon script completes.

Code:
Break On

Dim $PC,$Admin,$PCSet
$PC=@WKSTA
$PC=SubSTR($PC,1,2)+SubStr($PC,4,1)+SubStr($PC,6)
? 'The value for PC is: ' + $PC
; line above so you can see it displayed on the DOS Console
$Admin=IIf(InGroup(@WKSTA+'\'+SidToName('S-1-5-32-544'))-1+@INWIN=1,'Yes','No')
If $Admin='Yes'
$PCSet=WriteValue('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment','TERM',$PC,REG_SZ)
Else
$PCSet=WriteValue('HKCU\Volatile Environment','TERM',$PC,REG_SZ)
EndIf




Edited by NTDOC (2005-03-16 06:22 PM)