Page 1 of 1 1
Topic Options
#242 - 1999-08-02 05:36 AM Reading NT Environment Variables
Anonymous
Unregistered



I need a kix script to be able to read a couple of environment variables which are only available in the current session of an application therefore are not part of the environment stored in the registry.

I can't see any obvious way of doing this.
Anyone come across and solved this problem.

Thanks

Top
#243 - 1999-08-03 10:36 AM Re: Reading NT Environment Variables
Anonymous
Unregistered


What variables are you looking for?

------------------
Anthony J. Reno
renoa@rfa.org


Top
#244 - 1999-08-04 03:19 AM Re: Reading NT Environment Variables
Anonymous
Unregistered


The environment variables are created by a particular application and valid only for that application.

I suppose the general question how can I read an environment variable into a Kixtart variable if that environment variable is not covered by a Kixtart Macro.

Top
#245 - 1999-08-19 02:11 AM Re: Reading NT Environment Variables
Anonymous
Unregistered


This is the way i got an environment variable.

------------------------------------
$ClientName="onbekend" ; SET $Clientname to unknown (in case of error)
$FileName = "C:\TEMP\" + @USERID + "\CLIENT.TXT" ; SET PATH to write to
RUN "%COMSPEC% /C SET CLIENTNAME > " + $FileName ; write ENVIRONMENT variables in $FileName
SLEEP 1 ; Give DOS time to wite $FileName

IF OPEN(1,$FileName)=0 ; OPEN $FileName for READ
$Regel=ucase(READLINE(1)) ;
$Gevonden="NEE" ;
WHILE @ERROR=0 AND $Gevonden="NEE" ; DO while !eof AND !found CLIENTNAME
IF INSTR($Regel,"CLIENTNAME") > 0 ; CHECK for Variable CLIENTNAME
$Gevonden="JA" ; if found SET Boolean $Gevonden True
ELSE ; CLIENTNAME !found
$Regel=READLINE(1) ; READ next line
ENDIF ; !eof AND !found
LOOP ;

------------------------------------

Top
#246 - 1999-08-19 03:04 AM Re: Reading NT Environment Variables
Anonymous
Unregistered


Stupid me.......

$KixtartVariableName=%DosVariableName%

:-)


Top
#247 - 1999-08-25 06:34 AM Re: Reading NT Environment Variables
Anonymous
Unregistered


Stupid me too. Like a lot of things the answer is in the Kixtart manual if you look hard enough.

Luuk - the manual agrees with you. Thanks for you reply

Ken

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
1 registered (Glenn Barnas) and 1135 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.147 seconds in which 0.108 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