PC Review


Reply
Thread Tools Rate Thread

Checking for env. var.

 
 
Larry
Guest
Posts: n/a
 
      16th Sep 2004
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...


 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      16th Sep 2004
"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 ..... ?

see if /?

HTH
--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
Paul R. Sadowski
Guest
Posts: n/a
 
      16th Sep 2004
"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
)


 
Reply With Quote
 
LWG
Guest
Posts: n/a
 
      16th Sep 2004
Paul, that is what I was looking for, I needed the reverse of what I was
trying to do...

Thx, Larry
"Paul R. Sadowski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "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
> )
>
>



 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      17th Sep 2004
"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
 
Reply With Quote
 
David Candy
Guest
Posts: n/a
 
      17th Sep 2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Checking with checking cell notes =?Utf-8?B?amZpdHpwYXQ=?= Microsoft Excel Misc 0 8th Aug 2007 10:26 PM
Checking range of cells for entry then checking for total =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Programming 1 13th Oct 2006 02:47 PM
Some Word docs not spell checking even after checking settings. =?Utf-8?B?WmVl?= Microsoft Word Document Management 3 26th Feb 2006 01:45 PM
Conflicting used space information when checking the drive property against marking all files and checking the marked file properties. elloko Windows XP Configuration 3 19th Dec 2004 05:34 AM
checking names not checking michael montagne Microsoft Outlook 7 13th Aug 2004 01:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:17 PM.