Link to home
Start Free TrialLog in
Avatar of mastiSoft
mastiSoft

asked on

Program Files x86 Path

Hi,
How can I get path to Program Files (x86) ?
Avatar of jschristian44
jschristian44

I am unsure of what you mean.  Please clarifiy a little better?  The Program Files (x86) is where Windows stores files that are specific for 32-bit software.  All of the programs you install go into there.  It is in My Computer>C:>Program Files (x86).  If you want a shortcut to there to add to your desktop, just right click on the Program Files folder and click create shortcut.  Then drag it to your desktop.
System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)
Avatar of mastiSoft

ASKER

Hi
I need to get path to application that have exe file in Program Files(x86). Yes the PC is 64-bit bit.
I used the last suggestion and see what happens:
Error103      'ProgramFilesX86' is not a member of 'System.Environment.SpecialFolder'.
You will have to move to a newer version of Visual Studio. Older versions were designed before Microsoft started to use the x86 Program Files and do not have a definition for that special folder.

What version do you use?

I am puzzled by you Error 103. .NET does not use error codes. Could you sent a PrintScreen?
It is in the environment variable %programfiles(x86)%.  If you get the environment variable, expand it and use it as part of the file path, then you don't need to mess with the SpecialFolders.
to JamesBurger:
I use VS 2010. But I use to use Framework 2 because I don't want  tell to  my users to  install Framework 4 only to rum my application.
to Cup:
"It is in the environment variable %programfiles(x86)%." can you give me some example?
Strange idea not to ask users to install Framework 4. Unless you work with a very restrictive system manager that would still run Windows 3.1 because he fears that anything newer is not stable or secure enough, there is no reason to have your users make the move if you are developing in a tool that has been geared for that version.

Its like continuing to develop for VB4 because you do not want your users to install the VB6 runtime. You will tell me that the runtimes were a lot smaller in those times, but 2 GB hard disks where also smaller than what we get to day.

The framework installs in a snap. Framework 4 commes with framework 2 built-in, with extras, bugs that have been solved since 2007 (the last SP for framework 2.0), and enhanced performance on the top of that.

They have a 64-bits computer and run on a technology that is 8 years old? Why have such a computer if you use something that cannot access all its power? When you want to access specific features of their computer, you cannot do it because framework 2.0 is not designed for those features.

Don't get me wrong. I do not have a cell phone. I won't move to Denari (SQL Server 2012?) until I am forced to. I am not the kind of guy to jump on every new technology. But the framework 4.0 is old enough to have proven that it is stable and it has been designed for the types of computers you users have.

Restraining yourself and your users to the 2.0 framework is like continuing to use leaded gas in your car or listening to music on tape cassettes that cannot play at the right speed anymore, when the MP3 player (Framework 4.0) is free for the taking.

Unless they are in a very controlled environment, the first or second little thing they will grab for free on the Internet will require Framework 4.0 anyway. They might already have it unknowingly.
ASKER CERTIFIED SOLUTION
Avatar of cup
cup

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can empathize with mathiSoft.  I work in some environments which don't even have .net framework installed.  Sometimes the choice is down to whether you install .net framework for that one program or write it in something like VB6 or C++ that doesn't require .net framework.
Hi Jamesburger,
You don't do much programming for the US military, do you? No, I didn't think so.
Thanks for your extensive and useless lesson.