This is from our commercial login script:
 Code:
; Determine login type - direct, Terminal Server, or Citrix
; Con=Direct Console, RDP=Terminal Server, or ICA=Citrix
$ConnType = Left(%SESSIONNAME%, 3)
; Get list of connection types allowed to run login scripts
$Tag = ReadProfileString($INIFILE, 'COMMON', 'ConnType')
; If Connection Type Allow list is defined, current ConnType must be in list
If $Tag					; defined
  If Not InStr($Tag, $ConnType)		; if not in list
    DbgMsg('Invalid connection type - exiting.')
    Exit 0				; exit script
  EndIf
EndIf

"$Tag" can contain a list of allowed connection types in a space or comma-delimited string. If $Tag contains "ICA", the process will exit if the connection type is CONsole or RDP.

You might want to reverse the logic.. start by replacing the Exit with a result message, and hard-code the $Tag value for testing. This might get you going in the right direction.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D