Solved

How do i open a speficic folder through vb.net

Posted on 2007-12-07
7
438 Views
Last Modified: 2010-05-18
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
Comment
Question by:kengkit
7 Comments
 
LVL 19

Expert Comment

by:Rimvis
ID: 20426265
Shell("explorer C:\photo", AppWinStyle.NormalFocus)

0
 
LVL 7

Expert Comment

by:lucky_james
ID: 20426267
use shellexecute command.

check out:
http://www.vbaccelerator.com/codelib/shell/shellex.htm
0
 
LVL 7

Expert Comment

by:lucky_james
ID: 20426270
ShellEx "C:\My Documents\Music", , , , "Open", Me.hWnd
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 20426285
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 20426315
In vb.net 2005 you should use process to do that

Process.Start("explorer","c:\photo")
0
 

Author Comment

by:kengkit
ID: 20426330
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
 
LVL 19

Accepted Solution

by:
Rimvis earned 50 total points
ID: 20426360
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now