• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

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
0
kengkit
Asked:
kengkit
1 Solution
 
RimvisCommented:
Shell("explorer C:\photo", AppWinStyle.NormalFocus)

0
 
lucky_jamesCommented:
use shellexecute command.

check out:
http://www.vbaccelerator.com/codelib/shell/shellex.htm
0
 
lucky_jamesCommented:
ShellEx "C:\My Documents\Music", , , , "Open", Me.hWnd
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Pratima PharandeCommented:
0
 
jpaulinoCommented:
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
 
RimvisCommented:
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now