Hi ddady,

Can you give the code below a go and see if it provides correct results?
I added XenDesktop supoort but cannot test this myself.

 Code:
Break on

SessionType()

Sleep 5



;Function	SessionType()
;
;Contributors:
;		Inspired by 
;			http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=195460
;
;Action:
;		Gets the session type of the current user.
;
;Syntax:
;		SessionType()
;
;Version:
;		1.0 August 20th 2009.
;			Initial post.
;
;Parameters:
;		None.
;
;Returns:
;		String value holding the session type.
;		Currently supports Console, RDP and ICA.
;
;Dependencies
;		No known dependencies
;
;KiXtart:
;		Developed and tested KiXtart 4.60 and Windows Vista Business SP2.
;
;Example(s):
;		Break on
;		$rc = SessionType()
;		$rc
;		Sleep 5
;
;Code:
Function SessionType()
	
	Dim $sessionname
	
	$sessionname = ExpandEnvironmentVars(%sessionname%)
	
	Select
		Case Left($sessionname, 3) = "Con"
			$sessiontype = "Console session"
		Case Left($sessionname, 3) = "RDP"
			$sessiontype = "Remote desktop session"
		Case Left($sessionname, 3) = "ICA"
			$sessiontype = "Citrix ICA session"
		Case Left($sessionname, 9) = "CtxMtHost"
			$sessiontype = "Citrix XenDesktop session"
		Case 1
			$sessiontype = "Unknown session type"
	EndSelect
EndFunction
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.