Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2010 Environment Variable X86 x X64

$
0
0
Hi

My application it's targeting x86, the machine it's a x64. I need the common program files path for the current machine.

But after expanding the commonprogramfiles var or commonprogramfiles(x86), or by using the special folder enum, in both situations it returns the x86 path...

Code:

?Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles)
"C:\Program Files (x86)\Common Files"
?Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86)
"C:\Program Files (x86)\Common Files"

?Environment.ExpandEnvironmentVariables("%commonprogramfiles%")
"C:\Program Files (x86)\Common Files"
?Environment.ExpandEnvironmentVariables("%commonprogramfiles(x86)%")
"C:\Program Files (x86)\Common Files"

Why i cant get the "C:\Program Files\Common Files" ?!?!
It's because of the target CPU?!

Thanks

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>