Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

How do you get the CommonFilesFolder and CommonFilesFolder64?

For example:

 

C:\Program Files\Common Files\

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

 

In VB.NET on a x64 platform?

I know how to use Environment to get CommonFiles folder but it returns the x86 folder and not x64, maybe because my app is set to x86?

 

However, I need to get both paths correctly, anyway you know?

Please help, thanks :)

  • Administrators
Posted
The Environment class exposes both a Environment.SpecialFolder.CommonProgramFiles and a Environment.SpecialFolder.CommonProgramFilesx86 - if you use these with the Environment.GetFolderPath method then on a 64bit os with an application built for x64 or AnyCpu then Environment.SpecialFolder.CommonProgramFiles should return the x64 path - if you are running an x86 build then it will return the x86 path.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...