Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 by Thearon Willis, Bryan Newsome; ISBN: 9780764574016
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2006, 05:21 AM
Authorized User
 
Join Date: Feb 2006
Location: Dubai, UAE, United Arab Emirates.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default SpecialDirectories

Dear All,

Could anyone tell me how to get the full path of “windows” directory using SpecialDirectories?

To get the path of MyDocuments folder, the code will be like this:

My.Computer.FileSystem.SpecialDirectories.MyDocume nts the result will be like this C:\Documents and Settings\Administrator\My Documents. What about Windows folder?

Apreciate your help…

Best regards,

PHENOM

>>>PHENOM<<<
__________________
>>>PHENOM<<&amp ;lt;
 
Old April 9th, 2006, 05:49 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Location: Fuquay Varina, NC, USA.
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Phenom,

Using the following code:

        Dim strSystemDirectory As String = Environment.SystemDirectory
        Dim strWindows As String = strSystemDirectory.Substring(0, strSystemDirectory.LastIndexOf("\"))
        Dim strSystem As String = strSystemDirectory.Substring(strSystemDirectory.La stIndexOf("\") + 1)

Yeilds the following results on a Windows XP machine:

strSystemDirectory = "C:\WINDOWS\system32"
strWindows = "C:\WINDOWS"
strSystem = "system32"

I hope this helps.

Thearon
 
Old April 10th, 2006, 06:19 AM
Authorized User
 
Join Date: Feb 2006
Location: Dubai, UAE, United Arab Emirates.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Thearon
 Phenom,
Using the following code:
        Dim strSystemDirectory As String = Environment.SystemDirectory
        Dim strWindows As String = strSystemDirectory.Substring(0, strSystemDirectory.LastIndexOf("\"))
        Dim strSystem As String = strSystemDirectory.Substring(strSystemDirectory.La stIndexOf("\") + 1)
Yeilds the following results on a Windows XP machine:
strSystemDirectory = "C:\WINDOWS\system32"
strWindows = "C:\WINDOWS"
strSystem = "system32"

I hope this helps.

Thearon
Dear Thearon :),

Thank you very much… You always help & Right :)

Wish you all the best and luck..

Have a nice day...

PHENOM








Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.