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

Windows directory

P: n/a
Hi all.
How can I retrieve the windows directory (not system!) in VB.Net?
Thanks in advance.

VV
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
http://www.codeproject.com/useritems/SystemUtility.asp

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Wally" <va****@nospamcambieri.it> wrote in message
news:Fh***********************@news3.tin.it...
Hi all.
How can I retrieve the windows directory (not system!) in VB.Net?
Thanks in advance.

VV

Nov 21 '05 #2

P: n/a
Hi,

Trace.WriteLine(Environment.GetEnvironmentVariable ("windir"))

Ken

-------------------

"Wally" <va****@nospamcambieri.it> wrote in message
news:Fh***********************@news3.tin.it...
Hi all.
How can I retrieve the windows directory (not system!) in VB.Net?
Thanks in advance.

VV

Nov 21 '05 #3

P: n/a
On Wed, 15 Sep 2004 13:17:25 GMT, "Wally" <va****@nospamcambieri.it> wrote:

Hi all.
How can I retrieve the windows directory (not system!) in VB.Net?
Thanks in advance.

Dim WinSysPath As String = System.Environment.GetFolderPath(Environment.Speci alFolder.System)
Dim WinPath As String = WinSysPath.Substring(0, WinSysPath.LastIndexOf("\"))
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 21 '05 #4

P: n/a
Good answer , much cleaner than mine and managed as well !

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
Hi,

Trace.WriteLine(Environment.GetEnvironmentVariable ("windir"))

Ken

-------------------

"Wally" <va****@nospamcambieri.it> wrote in message
news:Fh***********************@news3.tin.it...
Hi all.
How can I retrieve the windows directory (not system!) in VB.Net?
Thanks in advance.

VV

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.