Board index » Visual Studio » login script for TS but not regular windows

login script for TS but not regular windows

Visual Studio154
I have a login script that I want to run during a terminal services session

but not for regular windows session. I can't figure out how to make this

happen. Is there something in the script I can tell it if there is no

clientname or no session to skip to the end? Otherwise, my users will get an

error when they login to their normal windows session.



Thanks,



Kathy Spier

Hillcrest Health Systems

Bellevue, NE


-
 

Re:login script for TS but not regular windows

I use a variation of this as a bat login script. Basically, it uses the

environment variable %clientname% to determine whether or not it is a

citrix/TS session or otherwise.



@echo off

REM If the user logging in has no clientname (like a

REM Windows 9x/Me/2K client) var defined, and is NOT

REM a Citrix/TS client, goto COMMON.

REM

REM If it is a local logon (console) to an XP or

REM 2000-Terminal Server, or 2003 go to the COMMON section

REM (Since XP,200TS,2003 have RDP console sessions

REM built in)

REM

REM If it is a remote Citrix/TS client, goto the

REM METAFRAME section.

REM

IF !%clientname%!==!! Goto COMMON

IF %clientname%==Console Goto COMMON

GOTO METAFRAME



:COMMON

REM Section for ALL Clients that are not

REM Citrix/TS remote connections.

@echo.

@echo Now running command set for Windows 9x/NT based OS...

@echo.



if NOT "%computername%" == "" echo User '%username%' is logged into PC

'%computername%'

@echo.



Goto END



:METAFRAME

REM Input commands here that are specific to Citrix/TS Sessions

Net use H: \\%servername%\home /y>NUL



Goto END



:END



"Kathy" <Kathy@discussions.microsoft.com>wrote in message

Quote
I have a login script that I want to run during a terminal services session

but not for regular windows session. I can't figure out how to make this

happen. Is there something in the script I can tell it if there is no

clientname or no session to skip to the end? Otherwise, my users will get

an

error when they login to their normal windows session.



Thanks,



Kathy Spier

Hillcrest Health Systems

Bellevue, NE







-

Re:login script for TS but not regular windows

Thanks. Do you know how that can be translated into vbscript?



"maximillianx" wrote:



Quote
I use a variation of this as a bat login script. Basically, it uses the

environment variable %clientname% to determine whether or not it is a

citrix/TS session or otherwise.



@echo off

REM If the user logging in has no clientname (like a

REM Windows 9x/Me/2K client) var defined, and is NOT

REM a Citrix/TS client, goto COMMON.

REM

REM If it is a local logon (console) to an XP or

REM 2000-Terminal Server, or 2003 go to the COMMON section

REM (Since XP,200TS,2003 have RDP console sessions

REM built in)

REM

REM If it is a remote Citrix/TS client, goto the

REM METAFRAME section.

REM

IF !%clientname%!==!! Goto COMMON

IF %clientname%==Console Goto COMMON

GOTO METAFRAME



:COMMON

REM Section for ALL Clients that are not

REM Citrix/TS remote connections.

@echo.

@echo Now running command set for Windows 9x/NT based OS...

@echo.



if NOT "%computername%" == "" echo User '%username%' is logged into PC

'%computername%'

@echo.



Goto END



:METAFRAME

REM Input commands here that are specific to Citrix/TS Sessions

Net use H: \\%servername%\home /y>NUL



Goto END



:END



"Kathy" <Kathy@discussions.microsoft.com>wrote in message

news:38D7CAD1-3882-4D98-A7D9-B946CD6050A7@microsoft.com...

>I have a login script that I want to run during a terminal services session

>but not for regular windows session. I can't figure out how to make this

>happen. Is there something in the script I can tell it if there is no

>clientname or no session to skip to the end? Otherwise, my users will get

>an

>error when they login to their normal windows session.

>

>Thanks,

>

>Kathy Spier

>Hillcrest Health Systems

>Bellevue, NE

>







-