By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

variable programfiles(x86) loses space

Although set shows 2 spaces in the variable programfiles(x86) when I go to use it the second space disappears making the variable not very useful:

C:\>set programfile*
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)

C:\>echo --"%programfiles"-- --"%programfiles(x86)"--
--"C:\Program Files"-- --"C:\Program Files(x86)"--


Oops, I'm sorry I see this has been addressed before.
I used %@sharefolder[38] to work around this seven characters shorter than %[ProgramFiles(x86)]
On Sat, 08 Jan 2011 17:47:16 -0500, hlhelman <> wrote:

|C:\>set programfile*
|ProgramFiles=C:\Program Files
|ProgramFiles(x86)=C:\Program Files (x86)
|C:\>echo --"%programfiles"-- --"%programfiles(86)"--
|--"C:\Program Files"-- --"C:\Program Files(86)"--

You didn't ask for the right thing in the second case. Didn't you want

Anyway, even that would have failed:

v:\> set
ProgramFiles(x86)=C:\Program Files (x86)

v:\> echo %programfiles(x86)
C:\Program Files(x86)

The sapce wasn't removed. What happened was that %programfiles was echoed
subsequently followed by the literal) "(x86)". That's one way to interpret
"%programfiles(x86)". And it's understandable; how's TCC to know where the
variable name ends?

Get around it like this, by telling TCC exactly what the variable name is:

v:\> echo %[programfiles(x86)]
C:\Program Files (x86)

Similar threads