Page 1 of 1 1
Topic Options
#58990 - 2001-09-11 06:29 PM Terminal Server session
kj2n Offline
Fresh Scripter

Registered: 2001-09-11
Posts: 6
Is there a command you could use to determine if the user is logging onto a terminal session or not? I would like to run a set of commands if it is a terminal session, otherwise, ignore the script. Is this possible using kixtart?

Thanks,

Kyle

Top
#58991 - 2001-09-11 07:22 PM Re: Terminal Server session
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There are several ways to achieve that, which have been posted to the board. What version of KIX and Terminal Server?

A quick search for "Terminal" in the "Scripts" section bring up many examples.

[ 11 September 2001: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58992 - 2001-09-12 10:33 AM Re: Terminal Server session
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
The easiest way is to check for variables which are only set in the TS environment.

I use MetaFrame, and I check for WINSTATIONNAME - there are plenty of others.

Top
#58993 - 2001-10-16 04:24 AM Re: Terminal Server session
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.
See our script os.kix on our site
http://home.wanadoo.nl/scripting
for calculation of actual operating system version.
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#58994 - 2001-11-01 02:28 PM Re: Terminal Server session
Anonymous
Unregistered


Check for the environment variables CLIENTNAME or SESSIONAME. Both of these are specific to a terminal server session. If they're defined, you can assume they are logged in using TS.
Top
#58995 - 2001-11-01 02:29 PM Re: Terminal Server session
Anonymous
Unregistered


Oops ... that should be SESSIONNAME ...
Top
#58996 - 2001-11-01 02:50 PM Re: Terminal Server session
Anonymous
Unregistered


if %systemroot% = C:\WTSRV then it is a terminal server is another way
Top
#58997 - 2001-11-01 04:15 PM Re: Terminal Server session
Anonymous
Unregistered


%systemroot% can change from configuration to configuration. When I logon using TS, %systemroot% is set to "C:\Winnt".
Top
#58998 - 2001-11-01 09:48 PM Re: Terminal Server session
Anonymous
Unregistered


Apologies Larry you are of course correct and I am indeed a muppet - Cheque please!
Top
#58999 - 2001-11-01 10:10 PM Re: Terminal Server session
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
This thread should be allowed to die with dignity. KJ2N has not participated and there are already more than enough threads that dealt with this.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#59000 - 2001-11-01 11:46 PM Re: Terminal Server session
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
True - True,

I just hope KJ2N is still with us. That was his first and last post since then.

Hope your still around somewhere Kyle and this took care of your question.

Top
#59001 - 2001-11-02 12:11 AM Re: Terminal Server session
Will_Mac Offline
Fresh Scripter

Registered: 2001-10-06
Posts: 7
Loc: UK
I solved this problem by putting in the following in any script..this is only if you use thin clients to connect to TS and not workstations
;Get Workstation name
;
Break On
$wksta = @wksta

If SubStr($wksta ,1,2) = "NC"
EXIT 1
Endif
If SubStr($wksta ,1,2) = "Re"
GOSUB "Res"
EXIT 1
Endif
If SubStr($wksta ,1,2) = "Bs"
GOSUB "Bstud"
NC is the NCD name of the thin client.. you can either exit the script or just run whatever as a GOSUB... hope this helps

_________________________
Think you've got it cracked and then someone tells you about another prog....

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1619 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.069 seconds in which 0.035 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org