Solved

How do i open a speficic folder through vb.net

Posted on 2007-12-07
7
439 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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