How do i open a speficic folder through vb.net

how do i open a folder "c:\photo" by clicking a button in vb.net 2005?

* without prompt any dialog.. juz directly open the specific folder will do
kengkitAsked:
Who is Participating?
 
RimvisConnect With a Mentor Commented:
To you want to create a folder if it doesn't exists? In this case:

        Dim sRootFolder As String = "C:\photo"

        If Not Directory.Exists(sRootFolder) Then
            Directory.CreateDirectory(sRootFolder)
        End If

        Shell("explorer " & sRootFolder , AppWinStyle.NormalFocus)

0
 
RimvisCommented:
Shell("explorer C:\photo", AppWinStyle.NormalFocus)

0
 
lucky_jamesCommented:
use shellexecute command.

check out:
http://www.vbaccelerator.com/codelib/shell/shellex.htm
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
lucky_jamesCommented:
ShellEx "C:\My Documents\Music", , , , "Open", Me.hWnd
0
 
Pratima PharandeCommented:
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
In vb.net 2005 you should use process to do that

Process.Start("explorer","c:\photo")
0
 
kengkitAuthor Commented:
to Rimvis

how do i handle a situation if  the folder is no longer exited?

and the following coding seem not working.. how to solve it?

Dim path as string = "c:\photo\" & member.Text

Shell("explorer" & path, AppWinStyle.NormalFocus)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.