Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 201001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:09:40+00:00 2026-05-11T17:09:40+00:00

Our client (a winforms app) includes a file-browser. I’d like the user to be

  • 0

Our client (a winforms app) includes a file-browser. I’d like the user to be able to open the selected file using the shell’s default handler. How do I do that? I’ve read that I should use the Win32 API rather than the registry, but I’d prefer a solution that involves only .NET.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:09:40+00:00Added an answer on May 11, 2026 at 5:09 pm

    EDIT: Newer, simpler answer.

    You can indeed just use Process.Start(filename). This is specified in the docs for Process.Start:

    Starting a process by specifying its
    file name is similar to typing the
    information in the Run dialog box of
    the Windows Start menu. Therefore, the
    file name does not need to represent
    an executable file. It can be of any
    file type for which the extension has
    been associated with an application
    installed on the system. For example
    the file name can have a .txt
    extension if you have associated text
    files with an editor, such as Notepad,
    or it can have a .doc if you have
    associated.doc files with a word
    processing tool, such as Microsoft
    Word. Similarly, in the same way that
    the Run dialog box can accept an
    executable file name with or without
    the .exe extension, the .exe extension
    is optional in the fileName parameter.
    For example, you can set the fileName
    parameter to either “Notepad.exe” or
    “Notepad”.

    EDIT: Original, complicated answer:

    If you use Process.Start with the file as the “executable” and specify UseShellExecute = true it will just work. For example:

    using System;
    using System.Diagnostics;
    
    class Test
    {
        static void Main()
        {
            ProcessStartInfo psi = new ProcessStartInfo("test.txt");
            psi.UseShellExecute = true;
            Process.Start(psi);
        }
    }
    

    That opens test.txt in Notepad.

    In fact, UseShellExecute=true is the default, but as it’s definitely required I like to specify it explicitly to make that clearer to the reader.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 221k
  • Answers 221k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you're trying to determine whether a certain value exists… May 13, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer This fine print in the SDK docs for LowLevelKeyboardProc is… May 13, 2026 at 12:10 am
  • Editorial Team
    Editorial Team added an answer If JTidy is really what you want, there is a… May 13, 2026 at 12:10 am

Related Questions

Our client (a winforms app) includes a file-browser. I'd like the user to be
We have a WinForms app that runs fine on x86, but has many third-party
We'd like to see if we can get some improved performance for analysis and
I am starting a new Winforms application, and I've always used traditional ADO.NET methods
Haven't seen many Geneva related questions yet, I have posted this question in the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.