Environment vars

Posted: 01-19-2009, 02:51 PM
Hi,

I need to define a set of env vars that point to a particular file tree like
so: APP_VER = C:\APP.1.2.3. I then use that var in other vars like so: PATH
= %APP_VER%\bin;... We changes versions quite often, and all I want to need
to do is change the value of APP_VER and the other vars change accordingly.
(I use the System Properties dialog to set the vars.)

The problem is that after a period of time, %APP_VER% gets replaced with
its value in the other vars, i.e. it gets expanded like so:
PATH=C:\APP.1.2.3\bin;...

How does that happen and what can I do to prevent the expansion?

Thank you,
Jim




Environment vars


Responses to "Environment vars"

Pegasus \(MVP\)
Guest
Posts: n/a
 
Re: Environment vars
Posted: 01-19-2009, 03:18 PM

"Jim Brown" <noSpam@noMail.com> wrote in message
news:%23AHuUWkeJHA.4684@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I need to define a set of env vars that point to a particular file tree
> like
> so: APP_VER = C:\APP.1.2.3. I then use that var in other vars like so:
> PATH
> = %APP_VER%\bin;... We changes versions quite often, and all I want to
> need
> to do is change the value of APP_VER and the other vars change
> accordingly.
> (I use the System Properties dialog to set the vars.)
>
> The problem is that after a period of time, %APP_VER% gets replaced with
> its value in the other vars, i.e. it gets expanded like so:
> PATH=C:\APP.1.2.3\bin;...
>
> How does that happen and what can I do to prevent the expansion?
>
> Thank you,
> Jim
What makes you think that the expansion takes place? I suspect you're
looking at an instance where the variable is interpreted. The registry value
for %path% is most likely still %App_Ver%\bin, exactly as you defined it.
You can easily verify this by having a look here:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.


 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Environment vars Jim Brown Windows XP Help & Support 0 01-16-2009 10:25 PM
[gentoo-dev] removal of vars from ebuild env Brian Harring Gentoo Linux 0 08-23-2005 06:00 AM
Excel X passing vars VBA/AS and AS/VBA Mark Anderson Mac Office Excel 4 01-05-2005 11:56 AM
Static vars aren't static enough Jerry Natowitz Mac Office Excel 4 07-06-2004 02:12 PM