user774411
user774411

Reputation: 1809

How do I open a windows explorer window with a specific folder selected

I have a winform application and this winform application has created few files. I want to implement "find target" function in my application to show those files. Those files located in a same folder. See the picture:

find target functionality as in windows xp

Let's say that I have created few files in "C:\Test\" folder and this folder has this file: "C:\Test\File1.txt". How to create "find target" functionality using VB.NET?

Upvotes: 13

Views: 26413

Answers (2)

Rhapsody
Rhapsody

Reputation: 6077

Use Process.Start() to start the Windows Explorer:

Process.Start("explorer.exe", "/select," & "FILETOSELECT")

With the /select, [file] parameter, you can highlight the file.

Upvotes: 35

Jude Cooray
Jude Cooray

Reputation: 19862

Take a look at this article where it specifies the arguments, explorer.exe takes in

Then use System.Diagnostics.Process.Start

Upvotes: 8

Related Questions