471,616 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

Refering to "Program Files" directory

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.

--
Konrad Viltersten
Jun 27 '08 #1
2 1472
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles);

mARC
Jun 27 '08 #2
Well, you have environment variables: %ProgramFiles% (and on x64,
%ProgramFiles(x86)% / %ProgramW6432%) - or through code you have:

string path =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles);
Exactly what i was looking for. Thanks!

Regards
Konrad Viltersten
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Robert Oschler | last post: by
1 post views Thread by Sam Martin | last post: by
2 posts views Thread by John Saunders | last post: by
7 posts views Thread by Matt Jensen | last post: by
reply views Thread by Terry Olsen | last post: by
9 posts views Thread by Keith G Hicks | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.