new problem. When running this.
$ComputerPrt = Left(@wksta, 6)
If $ComputerPrt = "VA-CTX"
Run "\\server\netlogon\XDClientName.exe"
the xdclient variable is present, but i've looked all the time at the system properties under advanced - systemvariables. there is it present, but when do a "set" from commandprompt the variable isn't there. when i then run the xdclient manually then it's also available when do the "set" command, and that's why no printers where added.
can this cause this xdclient runs too early for windows perhaps.
....
I got a small explanation from Glenn about the xdclientname app and it seems it does not run that well from kix. If you start it from a batch file and directly after this start the kix script it should be better.
....
it's getting funnier every time;)
....
Yes, that’s how it goes sometimes. At some time you will start pulling out your hair, wanting to throw the computer out the window and beat up the first person asking you "Is it done yet?" for no reason but just because you can. These things might be great to blow off some steam but they do not help to fix the issue

....
I found also a registry setting, maybe it's possible to use this.
within the virual client the physical computername is visible under:
HKLM\software\citrix\PortICA\uxpersistence\LA-DOC-001
....
Great! You could use ReadValue to get this registry value and start connecting printers based on the result. A small example below. It assumes that the registry key is HKLM\software\citrix\PortICA, the value is uxpersistence and its contents is the name of the physical client.
$ComputerPrt = Left(@WKSTA, 6)
If $ComputerPrt = "VA-CTX"
$client = ReadValue("HKLM\software\citrix\PortICA", "uxpersistence")
Select
Case Left($client, 6) = "LA-DOC"
;Connect LA-DOC printers.
Case Left($client, 6) = "LA-ROO"
;Connect LA-ROO printers.
Case Left($client, 6) = "aaaaaa"
;Connect aaaaaa printers.
EndSelect
Else
;Do stuff for non xen sessions.
EndIf