Page 1 of 1 1
Topic Options
#31217 - 2002-10-22 08:19 PM Environment Variables
str1der Offline
Fresh Scripter

Registered: 2002-10-07
Posts: 33
Loc: Cincinnati
Does an environemt variable get passed to a kix script. For instance if I set a variable in a batch file that then calls a kix script can the variable be referred to in the script? Thanks.
Top
#31218 - 2002-10-22 08:22 PM Re: Environment Variables
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Short answer - yes
? '%comspec%'
_________________________
We all live in a Yellow Subroutine...

Top
#31219 - 2002-10-22 08:29 PM Re: Environment Variables
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
still, remember that "current" env variables do not get there.
like %1,%2 and such will not pass as kix does not get them the same way.
_________________________
!

download KiXnet

Top
#31220 - 2002-10-22 08:36 PM Re: Environment Variables
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Check the Kix manual under SET, SETL, SETM for environment variable stuff...
_________________________
We all live in a Yellow Subroutine...

Top
#31221 - 2002-10-22 08:37 PM Re: Environment Variables
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the KiXtart Manual on how to pass external variables into a KiXtart Script. Hint: KIX32.EXE SCRIPT.KIX $Var=WHATEVER
_________________________
There are two types of vessels, submarines and targets.

Top
#31222 - 2002-10-22 08:51 PM Re: Environment Variables
str1der Offline
Fresh Scripter

Registered: 2002-10-07
Posts: 33
Loc: Cincinnati
Thanks. I just want to pass a variable like Citrix=True from the batch file we use to launch a citrix session.
Top
#31223 - 2002-10-22 09:53 PM Re: Environment Variables
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
str1der,
Where are you coming from and where are you going?

You say "from the batch file we use to launch a citrix session"

If this batch file is at the client and the script is running on the server, never the two shall meet.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#31224 - 2002-10-24 05:38 PM Re: Environment Variables
str1der Offline
Fresh Scripter

Registered: 2002-10-07
Posts: 33
Loc: Cincinnati
I'm not the Citrix guy so maybe I didn't state that correctly. First they logon to the network (running full script), then they launch a citrix session. When they launch the citrix session a variable gets set. (MF=TRUE). If MF=TRUE in the script it exits before a lot of garbage is run again. Also what would be the exact syntax for the IF statment in KIX. Would it be something like this?

If %MF% = "TRUE"

EXIT

ENDIF

Top
#31225 - 2002-10-24 05:41 PM Re: Environment Variables
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I believe you'll need to use EXPANDENVIRONMENTVARS() to retrieve the actual value of the environment variable. Check the KiXtart Manual.
_________________________
There are two types of vessels, submarines and targets.

Top
#31226 - 2002-10-24 05:54 PM Re: Environment Variables
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Correct.

If %MF% = "TRUE"
   EXIT 1
ENDIF
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 595 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.059 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