Page 1 of 1 1
Topic Options
#47550 - 2003-11-03 08:50 PM KiX can't use env var in string?
musicon Offline
Lurker

Registered: 2003-10-21
Posts: 3
Loc: USA
This is taken from a much larger script, so please excuse the missing info. With the following code, why is it that KiX can't find the file specified?

code:
$string = READPROFILESTRING ($INIFile, $section, $key)
? GETFILEVERSION ($string, "ProductVersion")

After reading the information from the ini file, $string contains "%WINDIR%\System32\jscript.dll".
Kix echos nothing... If I replace the env var with the exact path, then it correctly returns the version string. But of course that breaks if windows isn't installed in the default directory.

Thanks, later...

Top
#47551 - 2003-11-03 08:52 PM Re: KiX can't use env var in string?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
RTFM
ExpandEnvironmentVars( )
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#47552 - 2003-11-03 08:53 PM Re: KiX can't use env var in string?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Have you taken a look at the manual?

Does this correct the problem?
code:
ExpandEnvironmentVars( )

Action: Expands any environment variables inside a string to the corresponding plain text value.

Syntax: EXPANDENVIRONMENTVARS ("string")

Parameter: String
The string you want to expand.

Returns: The expanded string.

Example: $Value = ReadValue( "HKLM\System\CurrentControlset\Control\Windows", "SystemDirectory")
? ExpandEnvironmentVars( $Value )

_________________________
Home page: http://www.kixhelp.com/hb/

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 (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.039 seconds in which 0.019 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