Page 2 of 2 <12
Topic Options
#184815 - 2008-01-24 04:06 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Glenn Barnas]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
LoL, thanks man.... I copied it directly from the posts above, too bad I didn't know better, thanks! I'll try that and see how it works!!
Top
#184816 - 2008-01-24 04:16 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
Ok, tested out good locally, so I'm keeping my fingers crossed for the full test. Thanks for the help Glenn!
Top
#184818 - 2008-01-24 04:28 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4400
Loc: New Jersey
Yeah - saw and corrected the typo in my example - sorry!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#184820 - 2008-01-24 09:39 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Glenn Barnas]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
No problem. But, here is new issue. The variable they have set is SRV, and the value is equal to Citrix. How would I modify the code to work with that?
Top
#184822 - 2008-01-24 09:47 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You can change the name of the variable to whatever you need.
If the variable name is %SRV% and it exist when you are on a citrix session then this should work.

 Code:
; Exit immediatly if SRV is not null
If '%SRV%' Quit 0 EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#184823 - 2008-01-24 09:52 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mart]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
Yes, I realized that part, but the value of the Variable is set to Citrix, can we have it verify the value of the variable as well?
Top
#184826 - 2008-01-24 10:05 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Yes. You could do something like If %SRV% == Citrix to check the value of %SRV%.

More info on batch scripting: http://www.ss64.com/nt/if.html
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#184828 - 2008-01-24 10:23 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4400
Loc: New Jersey
 Code:
If '%SRV%' = 'Citrix' Quit 0 EndIf

This way, if the Citrix Servers have SRV defined as Citrix, and other servers have it defined differently, it will exit on the citrix servers only. The more generic comparison will exit anywhere that the SRV variable is defined, no matter what it is defined as.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#184829 - 2008-01-24 10:53 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Glenn Barnas]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
Exactly my issue. I didn't want to just exit on SRV. Thanks Mart and Glenn. I will be testing tomorrow. Have a good one!
Top
#184830 - 2008-01-24 11:59 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mart]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4400
Loc: New Jersey
Just a heads-up about Mart's example -it is for a batch file, not kix - just so we're all clear. A caution about this example, though.. while valid, it can cause a frustrating error if the variable is not defined - frustrating because the code "looks" valid (and is, in most circumstances).

If the variable is not defined, the code you posted will be interpreted as
If == Citrix Exit
The LValue of the comparison is missing! You should always take this into account in batch scripting, and there are lots of unique ways to do this, including
If [%VAR%]==[something]
If "%VAR%=="" (nothing, in this case)
or
If x%VAR%==xSomething

These all prevent a syntax errror when the variable is undefined or null. Been bitten by this enough times to see it now.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#184849 - 2008-01-25 01:57 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Glenn Barnas]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
Thanks for the headsup Glenn. I'm just waiting for my people in Pittsburgh to update all Citrix servers with the same Variable so I can do my testing. I will let you know how it works. Thanks again, everyone, for the help.
Top
#185067 - 2008-02-04 05:22 PM Re: How to disable Logon Scripts for Citrix Logons [Re: Mephy]
Mephy Offline
Fresh Scripter

Registered: 2008-01-22
Posts: 18
Working like a charm, just wanted to update. Thanks for all the help guys!
Top
Page 2 of 2 <12


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

Who's Online
0 registered and 323 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.055 seconds in which 0.022 seconds were spent on a total of 14 queries. Zlib compression enabled.

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