1

Using this simple test batch script:

@echo off
echo %ProgramFiles%
echo %ProgramFiles(x86)%

is my output:

"C:\Program Files"
C:\Program Files (x86)

One variable is enclosed in quotes while the other isn't? Is this a bug of some sort, or a simple oversight on my behalf?

Matt Hanson
  • 1,682
  • 1
  • 23
  • 34

2 Answers2

3

Strange, I can't reproduce this on my machine (Windows Vista 64-bit SP 1). My output is

C:\Program Files
C:\Program Files (x86)

Are you sure you didn't insert quotes in your echo statement?

splattne
  • 28,508
  • 20
  • 98
  • 148
  • Hmm... I've rebooted since and now am getting the correct, expected result. I'm fairly positive that there were no quotes in my statements (as that was my first guess). I'll see if I can recreate the issue at all. – Matt Hanson May 17 '09 at 07:20
  • I'm blaming this one on "late night tinkering". I must have manually added quotes somewhere. Thanks anyways! – Matt Hanson May 21 '09 at 00:19
1

On W2k8 x64 I get:

c:\temp>echo %ProgramFiles% & echo %ProgramFiles(x86)%
C:\Program Files
C:\Program Files (x86)

If you type "set" you can see what the environment variables are. I get:

c:\temp>set
...
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
...
John Rennie
  • 7,776
  • 1
  • 23
  • 35