Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • Last Modified:

Open Folder in VB.Not

I want to open a folder in Windows Explorer, from code.
Can't figure out how to do it.  Suggestions please.
Thanks
0
jdhackett
Asked:
jdhackett
  • 2
2 Solutions
 
ladarlingCommented:
System.Diagnostics.Process.Start("C:\Windows")
0
 
ladarlingCommented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now