Where are you lost? My previous post told you that you can't set a variable on one line and then re-set it on the next and expect it to have two different values. Go back to what Glenn said and use Mart's suggestion to fill in the "xen = true" part. That was just pseudo code.

So, have a batch file launch it. Run the XD4ClientName application in the batch file and then call your kix script. In your kix script, use the SessionType function as Mart suggested to do the "xen = true " test.

So, start with a batch file:
 Code:
@Echo Off
Rem - set the XDCLIENTNAME environment var
XD4ClientName.exe
Rem - Run the Kix login script
kix32.exe kixtart.kix


In your kixtart.kix file:

 Code:
$sessiontype = SessionType()

If $sessiontype = "ICA"
   $computerprt = left ("%XDClientName%", 6)
else
   $computerprt = left (@wksta, 6)
endif

select 
   case $computerprt = "LA-FAC"
      AddPrinterConnection ("\\printserver\printer1")
      SetDefaultPrinter("\\printserver\printer1")
   case $computerprt = "LA-OFF"
      AddPrinterConnection ("\\printserver\printer2")
      SetDefaultPrinter("\\printserver\printer2")
   case $computerprt = "CA-REC"
      AddPrinterConnection ("\\printserver\printer3")
      SetDefaultPrinter("\\printserver\printer3")
   case $computerprt = "CA-ROO"
      AddPrinterConnection ("\\printserver\printer4")
      AddPrinterConnection ("\\printserver\printer1")
      SetDefaultPrinter("\\printserver\printer4")
endselect


Is that any clearer?