Refering to "Program Files" directory

  • Thread starter Thread starter K Viltersten
  • Start date Start date
K

K Viltersten

On WinXP, the directory where all the installed programs are stored, can
go under different names, depending on the language of the OS. E.g.
"c:\Program Files" on one system might be "d:\Program" on another. How
dows one refer to the "right" path? I'm remembering something along
"$Program" but i'd like to get an confirmation.
 
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

mARC
 
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);

Exactly what i was looking for. Thanks!

Regards
Konrad Viltersten
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top