Your tip was exactly right. if /? is the answer. It's the answer given by the Paul the Sodomite as well, who is a total idiot, as he says use If but says you are wrong for using If.
--
----------------------------------------------------------
War on the Pachyderms Terrorists
http://www.counterpunch.org/wilson09012004.html
"Matthias Tacke" <(E-Mail Removed)> wrote in message news:ciebdk$3h1$05$(E-Mail Removed)...
> "Paul R. Sadowski" wrote:
>
> >"Matthias Tacke" <(E-Mail Removed)> wrote in message
> >news:cics7k$i7r$02$(E-Mail Removed)...
> >> "Larry" wrote:
> >>
> >>>I need to test for a terminal server connection. If someone is connecting
> >>>to
> >>>a terminal server then I need to do something. The variable is:
> >>>
> >>>sessionname=xxxxx
> >>>
> >>>
> >>>How can I test for sesssion name regardless of what is to the right of the
> >>>=
> >>>sign? If there is any sessionname environment variable do something?
> >>>
> >>>Tia...
> >>>
> >> if defined sessionname ..... ?
> >
> >That won't work. SESSIONAME will normally be Console vs. something like
> >SESSIONNAME=RDP-Tcp#12 for a ts session.
> >
> >So...
> >if not "%SESSIONNAME%"=="Console" (
> >:: do stuff
> >)
> >
> Thanks for your better tip,
> in lack of a TS and based on OP's assumptions my tip fell short :-)
>
> --
> Greetings
> Matthias________________________________________
> For help on nt commands enter in a cmd window:
> W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm