kochesag Posted May 29, 2010 Posted May 29, 2010 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 :) Quote
Administrators PlausiblyDamp Posted May 29, 2010 Administrators Posted May 29, 2010 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.