Sorry, I was just trying to subtle about saying, "Read the manual." \:\)

That is a direct quote from the manual about how to read an environment variable.

I think you will have to first determine if the system is a virtual one or not. So,

 Code:
if xen = true
   $computerprt = "%XDClientName%"
else
   $computerprt = left (@wksta, 6)
endif


The way you have it, the variable will be overwritten even if it is a xen computer.