Solved

Open Folder in VB.Not

Posted on 2008-10-08
3
493 Views
Last Modified: 2012-05-05
I want to open a folder in Windows Explorer, from code.
Can't figure out how to do it.  Suggestions please.
Thanks
0
Comment
Question by:jdhackett
  • 2
3 Comments
 
LVL 11

Expert Comment

by:ladarling
ID: 22670507
System.Diagnostics.Process.Start("C:\Windows")
0
 
LVL 11

Accepted Solution

by:
ladarling earned 350 total points
ID: 22670576
Or, alternately, you could use:
Shell("explorer c:\windows", AppWinStyle.NormalFocus, False)
The first example lets the OS decide how best to open the folder. It will use the default application for the file/url specified.
This example ensures that Windows Explorer opens it. This would be an important feature if you were trying to open files, urls, etc. with a specific application.
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 150 total points
ID: 22670981
You can also specify the application to use with Process.Start (instead of Shell):

    Dim folder As String = "c:\some\Folder"
    System.Diagnostics.Process.Start("Explorer", folder)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

10 Experts available now in Live!

Get 1:1 Help Now