Solved

Open Folder in VB.Not

Posted on 2008-10-08
3
524 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 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