Results 1 to 3 of 3

Thread: program files folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86

    program files folder

    hey i want to create a program and i want to store some data in program files folder but when i use aother pc the program files folder is located at a diffrent hard drive
    i use C:/
    the other one use D:/
    now i want to ask if there is a way to find out easily where program files folder is located

    greetz

  2. #2
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: program files folder

    For 2005 you could do:

    VB Code:
    1. If My.Computer.FileSystem.DirectoryExists("C:\Program Files\") Then
    2.             MessageBox.Show("It's located in C drive")
    3.         ElseIf My.Computer.FileSystem.DirectoryExists("D:\Program Files\") Then
    4.             MessageBox.Show("It's located in D drive")
    5.         Else : MessageBox.Show("Couldn't find it at all!")
    6.         End If

    For 2003, use:

    system.IO.Directory.Exists(etc...)
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

  3. #3
    Fanatic Member TTn's Avatar
    Join Date
    Jul 2004
    Posts
    708

    Re: program files folder

    VB Code:
    1. System.Environment.SpecialFolder.ProgramFiles

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