Results 1 to 4 of 4

Thread: Easy way to get the \Windows folder on a PC

  1. #1

    Thread Starter
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366

    Easy way to get the \Windows folder on a PC

    Please can someone post some code on how I can detect the windows folder on the PC.

    Thanks

  2. #2
    Member
    Join Date
    Feb 2004
    Location
    LA
    Posts
    57
    Hi,

    If i understand you correctly you trying to see if the Folder exit. In this case use this code:

    Code:
    Imports System.IO
    
    Function IfExist() As Boolean
    Dim dir As Directory
            If dir.Exists(Path \ FolderName) = True Then
                Return True
            Else
                Return False
            End If
    
        End Function

  3. #3
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    Just use

    System.Environment.SystemDirectory()

    that will return system32 within the windows directory

    NICE and LITE
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Or use SpecialFolder Enum .
    VB Code:
    1. Environment.GetFolderPath(Environment.SpecialFolder.System)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width