Results 1 to 4 of 4

Thread: [RESOLVED] Displaying Files in Explorer

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2009
    Location
    Clive, IA in America!!!!
    Posts
    204

    Resolved [RESOLVED] Displaying Files in Explorer

    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?

  2. #2
    Hyperactive Member Runesmith's Avatar
    Join Date
    Oct 2008
    Posts
    399

    Re: Displaying Files in Explorer

    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.
    Runesmith

    The key to getting the right answer is asking the right question

    I just realized: good health is merely the slowest possible rate at which one can die

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Displaying Files in Explorer

    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:
    Code:
    explorer.exe /select,C:\test.txt
    http://support.microsoft.com/kb/314853
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2009
    Location
    Clive, IA in America!!!!
    Posts
    204

    Re: Displaying Files in Explorer

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width