Kill Login Scripts When Running a Citrix XenApp application

i'm running Citrix XenApp 6 on a Windows Server 2008 Std, R2.   Users are based off of Active Directory and normally use logon scripts (which are .bat files... eg.
net use w: \\server\folder
rundll32 printui.dll,PrintUIEntry /in /n \\server\printer


The problem is that the logon scripts takes up alot of time while waiting for the XenApp application to open up (after logging on to XenApp through its Web Client).  

Is there a way to tell Citrix, "yea listen if this connection is through Remote Desktop Services, kill the logon script"??   Particularly right after the script runs the "net use" command and obviously before the remote printers get installed...

i tried this command in the middle of the two lines but that actually not only stops the script for remote sessions, but also for normal logins..  
if @tssession
     exit 1
endif


thanks!
OrmatAsked:
Who is Participating?
 
Tony JConnect With a Mentor Lead Technical ArchitectCommented:
Well in a batch/cmd file environment you could put something like the following at the start of the script:

IF %COMPUTERNAME%=="CITRXSERVER1" Then goto quit
IF %COMPUTERNAME%=="CITRXSERVER2" Then goto quit
IF %COMPUTERNAME%=="CITRXSERVERn" Then goto quit

<Rest of your login script>

:quit

0
 
basrajCommented:
Check both pages of the below link. They have modified the script to exist if it says Citrix session. Similarly you can also modify your login script by defining a variable for TS and Citrix. This may not help completely but may give an idea:

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=184814&fpart=1
0
 
OrmatAuthor Commented:
Thanks. This was pretty much it. The only thing was that i had to modify the line a bit to the following to get it working:

IF %COMPUTERNAME% == server_name goto :quit
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.