Locate Directory on Hard disk....

Posted on 2006-05-11
Last Modified: 2010-04-16
I am looking to "locate file in folder", I have the Directory Path, and filename, how would I open windows explorer the that folder with that filename highlighted?
Question by:addicktz
    LVL 19

    Assisted Solution

    will do the half job

    LVL 85

    Accepted Solution

    Use the "/select" switch for explorer.exe:

            private void button1_Click(object sender, EventArgs e)
                String fileName = @"C:\Documents and Settings\Michael\My Documents\someFile.txt";
                System.Diagnostics.Process p = new Process();
                p.StartInfo.FileName = "explorer.exe";
                p.StartInfo.Arguments = @"/select," + fileName;
    LVL 1

    Author Comment

    i love you guys *tear*

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now