Page 1 of 1

Environment Variable with ( in it

Posted: Fri Mar 04, 2011 5:17 am
by WinstonJenks
Ok folks, in Windows, how do I get the value of the environment variable, ProgramFiles(x86)? Put $ProgramFiles(x86) in the message box gives: Message execution error:\nError description: Function: error in function handler.

I tried...
the Unix way: $(ProgramFiles(x86))...nah,
a Perlish way: ${ProgramFiles(x86)}...nah,
if Windows had a brain way: $"ProgramFiles(x86)"...nah,
single quote way: $'ProgramFiles(x86)'...nah, nah, nah. <US_local_joke>At this point a white duck shows up to save the day.</US_local_joke>

Finally, shell("echo %ProgramFiles(x86)%") worked, but it flashes up a distracting cmd prompt window. Maybe there is a better way?

Re: Environment Variable with ( in it

Posted: Fri Mar 04, 2011 3:04 pm
by BvG
because rev can't have brackets in variables, it can't show that env var to you. One could argue that's a bug, and I think it's entered in the database somewhere. Going trough Shell is actually the correct workaround, and as long as you set the hideConsoleWindows to true, it won't flash annoyingly.

Re: Environment Variable with ( in it

Posted: Sat Mar 05, 2011 12:39 am
by WinstonJenks
Thanks for the hideConsoleWindows idea! That will work for me.