Page 1 of 1 1
Topic Options
#37252 - 2003-03-04 09:11 AM if but not if... That is the question
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
Collective,

I need to test for two conditions.
First, if script see's a server, and is not Citrix (by name) then abort.

I have 2 variables:
IsServer = Yes
@Wksta = Citrix

I want to abort the script if IsServer = Yes, unless the @Wksta = Citrix. Perhaps I'm too tired now, but I can't get this to work. Hints / suggestions are completely welcome. [Smile]

Thanks
John
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#37253 - 2003-03-04 09:26 AM Re: if but not if... That is the question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany


if $IsServer and not instr(@wksta,'Citrix';IsServer is in this case anything but empty or 0 !
    quit
endif



assimilate this [Big Grin]

[ 04. March 2003, 09:27: Message edited by: jpols ]
_________________________



Top
#37254 - 2003-03-04 09:27 AM Re: if but not if... That is the question
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Write it as you'd say it...
code:
If $IsServer="Yes" AND @WKSTA <> "Citrix"
...Do your funky thang...
EndIf


Top
#37255 - 2003-03-04 09:28 AM Re: if but not if... That is the question
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Jochen, it looks like I'm doomed to follow you around the board this morning [Roll Eyes]

Must get a cup of coffee...

Top
#37256 - 2003-03-04 09:29 AM Re: if but not if... That is the question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yeah , got already my 4th [Razz]
_________________________



Top
#37257 - 2003-03-04 09:31 AM Re: if but not if... That is the question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Hi Jtrainer...

I'm not at work to really test this, but something like this should work.

As someone else comes online they may show you other code using the other macros of KiXtart 4.x

The use of the NOT operator requires you to be using KiXtart v4.x, but can be recoded if you're using v3.6x



$SRVR = ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions""ProductType")
IF $SRVR<>"WinNT" AND @Wksta NOT = "Citrix"
  QUIT
ENDIF


Top
#37258 - 2003-03-04 09:33 AM Re: if but not if... That is the question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Good point Ron !

ALWAYS tend to forget that some people might still use 3.x [Roll Eyes]
_________________________



Top
#37259 - 2003-03-04 09:33 AM Re: if but not if... That is the question
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Dang... clicked on MSN then came back and you guys jumped in line.

Hmmm.. I'm not a STARTERS Mod, so I can't boot your stuff. [Razz]

Oh well...

Top
#37260 - 2003-03-05 06:14 AM Re: if but not if... That is the question
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
All, thanks.

As I said, I was pretty tired. I had the line working, yet as tired as I was, I forgot to replicate the updated code to the netlogon share. So as you may imagine it failed.

Yes I'm using 4.x, so I know it works with the NOT operator.

The code I had is the same as what Richard used. Again thanks.

BTW, did you know a rouge Exit aborts a script? He He I knew I was too tired to script a logon change last night.
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#37261 - 2003-03-05 08:18 AM Re: if but not if... That is the question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yap, if stated at topmost level EXIT exits the script [Big Grin]
_________________________



Top
#37262 - 2003-03-05 09:39 AM Re: if but not if... That is the question
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
quote:
BTW, did you know a rouge Exit aborts a script?
Yeah? I suggest you use the dusky umber Exit, it doesn't suffer from this problem.

[Wink]

Top
#37263 - 2003-03-05 02:03 PM Re: if but not if... That is the question
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Dusky Umber? Is that Maybelline or Max Factor? Can't seem to find it here in the makeup drawer... [Wink] Maybe it's a rogue color?

G.
_________________________
Actually I am a Rocket Scientist! \:D

Top
#37264 - 2003-03-06 08:38 AM Re: if but not if... That is the question
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
Dusky Umber, Isn't he the cousin of the Max Factor heir that was convicted of raping all those girls with the date rape drugs?
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
Page 1 of 1 1


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

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.06 seconds in which 0.023 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