Solved

How do i open a speficic folder through vb.net

Posted on 2007-12-07
7
437 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

17 Experts available now in Live!

Get 1:1 Help Now