Each time a user logs in to one of these servers, the Batch File login script is run. The user does not need their drives mapped or any other functions to

be executed in order to access these applications. As you can imagine, each time a user logs in to one of these servers, its take quite a long time for them to login, as their drives are being mapped and so forth.

I understand that there is a batch file command called "IF %COMPUTERNAME%==".

Basically, I want the login script to be able to detect if a user is connecting to one of these Terminal Services and Citrix Servers, and if so, bypass the

drive mappings and other functions in the login script and go straight to ":END".

Would this work?

@ECHO OFF

IF %COMPUTERNAME%==SV-SRV1 GOTO END IF %COMPUTERNAME%==SV-SRV2 GOTO END IF %COMPUTERNAME%==SV-SRV3 GOTO END IF %COMPUTERNAME%==SV-SRV4 GOTO END IF %COMPUTERNAME%==SV-SRV5 GOTO END

RE: Batch File Login Script Help - IF COMPUTERNAME

sessionname variable will start with rdp or ica if you have a citrix session. You can view these from dos by just typing set.

You can work with strings using the set command there is examples of these below, just assign the leftmost 3 character to a variable and compare it to ica or rdp with a if command and you are good to go.

RE: Batch File Login Script Help - IF COMPUTERNAME

Thanks for all the responses and links to other VBS scripts. Can anyone help me with my specific problem (First Thread)?

Basically, I want the login script, which I already have, to be able to detect if a user is connecting to one of these Terminal Services and Citrix Servers, and if so, bypass the drive mappings and other functions in the login script and go straight to ":END".

"theravager" pointed me in the right direction, but need a little help from more experience batch scripting wiz's out there :)

RE: Batch File Login Script Help - IF COMPUTERNAME

and BTW I just read why you doing this, but if you look at the script I created http://www.tek-tips.com/viewthread.cfm?qid=1419083 , it sets a registry value so the script will only run one a day, that way they can logon as many times as they like the script will only run once at first logon. The second one was a 5 min job, and untested.