By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,136 Members | 2,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,136 IT Pros & Developers. It's quick & easy.

How to get full path for "Program Files" folder?

P: n/a
I'm using VB 2005. How to get the full path for "Program Files" folder in
Windows,
ie. either it is C:\Program Files or D:\Program Files or etc.?

How about the full path of "Windows" folder? (either C:\Windows or C:\WINNT
etc.)

Thanks for replying...

--
Regards,
Pedestrian, Penang.

Message posted via http://www.dotnetmonster.com

Aug 25 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"pedestrian via DotNetMonster.com" <u16758@uweschrieb:
I'm using VB 2005. How to get the full path for "Program Files" folder in
Windows,
ie. either it is C:\Program Files or D:\Program Files or etc.?

How about the full path of "Windows" folder? (either C:\Windows or
C:\WINNT
etc.)
<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/7ab94ed877bbf187>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 26 '06 #2

P: n/a

Herfried K. Wagner [MVP] wrote:
"pedestrian via DotNetMonster.com" <u16758@uweschrieb:
I'm using VB 2005. How to get the full path for "Program Files" folder in
Windows,
ie. either it is C:\Program Files or D:\Program Files or etc.?

How about the full path of "Windows" folder? (either C:\Windows or
C:\WINNT
etc.)

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/7ab94ed877bbf187>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Herfried - the trick by Bill doesn't work anymore. I think it hasn't
since 1.1. My personal favorite, is to just use the P/Invoke method.

--
Tom Shelton

Aug 26 '06 #3

P: n/a

pedestrian via DotNetMonster.com wrote:
I'm using VB 2005. How to get the full path for "Program Files" folder in
Windows,
ie. either it is C:\Program Files or D:\Program Files or etc.?
Console.WriteLine( _

System.Environment.GetFolderPath(Environment.Speci alFolder.ProgramFiles))

--
Tom Shelton

Aug 26 '06 #4

P: n/a
Thanks to both of you, Herfried and Tom...

--
Regards,
Pedestrian, Penang.

Message posted via http://www.dotnetmonster.com

Aug 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.