Results 1 to 4 of 4

Thread: [RESOLVED] help with opening a folder using Visual Basic 2010 Express

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    11

    Resolved [RESOLVED] help with opening a folder using Visual Basic 2010 Express

    how can i open a folder with Visual Basic, preferably with a Message Box?
    e.g. when the user clicks "OK" on a message, a certain folder will open.
    I am new to Visual Basic so can you please help me?
    thanks
    cool_asian

  2. #2
    Hyperactive Member
    Join Date
    Apr 2011
    Location
    England
    Posts
    421

    Re: help with opening a folder using Visual Basic 2010 Express

    Hi, something like this:
    VB.NET Code:
    1. 'Show a message box and test to see if the OK button was clicked
    2. If MessageBox.Show("Do you want to open a folder?", "Caption", MessageBoxButtons.OKCancel) = DialogResult.OK Then
    3.  
    4.     'Create a reference to the path you want to open
    5.     Dim Path As String = "c:\"
    6.  
    7.     'And open the folder using the Explorer.exe Process
    8.     Process.Start("Explorer.exe", Path)
    9.  
    10. End If
    Hope this helps

  3. #3
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: help with opening a folder using Visual Basic 2010 Express

    You could simply call

    Code:
    System.Diagnostics.Process.Start("C:\")

    This will open the c:\ path with the default explorer application
    Please mark you thread resolved using the Thread Tools as shown

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    11

    Re: help with opening a folder using Visual Basic 2010 Express

    thanks everyone, your replies have been very helpful.
    i appreciate your help

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