I want to be able to display a file in windows explorer. I have been able to open the parent folder, but I would like to have a specific file selected in explorer. What VB .Net Code would I use to do this?
Printable View
I want to be able to display a file in windows explorer. I have been able to open the parent folder, but I would like to have a specific file selected in explorer. What VB .Net Code would I use to do this?
I assume you mean you want to have an open file dialog window that opens inside your application, and that should have a specific file type displayed. If so, read up on OpenFileDialog class and the ways in which you can filter the content.
If you do actually mean Explorer itself and not an OpenFileDialog like Runesmith mentioned then you can just call the Explorer.exe with a specific argument that tells it which file to select:
http://support.microsoft.com/kb/314853Code:explorer.exe /select,C:\test.txt
Thank-you chris128. That was what I was looking for. I would use an OpenFileDialog to get the path, but wanted to display them in Explorer.exe....
Sorry for the confusion, but at least I got my answer!