Solved

Open Folder in VB.Not

Posted on 2008-10-08
3
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 86

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 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