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 6005041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:20:51+00:00 2026-05-23T01:20:51+00:00

There is a text file that I have created in my project root folder.

  • 0

There is a text file that I have created in my project root folder. Now, I am trying to use Process.Start() method to externally launch that text file.

The problem I have got here is that the file path is incorrect and Process.Start() can’t find this text file. My code is as follows:

Process.Start("Textfile.txt");

So how should I correctly reference to that text file? Can I use the relative path instead of the absolute path? Thanks.

Edit:
If I change above code to this, would it work?

string path = Assembly.GetExecutingAssembly().Location;
Process.Start(path + "/ReadMe.txt");
  • 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-23T01:20:51+00:00Added an answer on May 23, 2026 at 1:20 am

    Windows needs to know where to find the file, so you need somehow specify that:

    Either using absolute path:

    Process.Start("C:\\1.txt");
    

    Or set current directory:

    Environment.CurrentDirectory = "C:\\";
    Process.Start("1.txt");
    

    Normally CurrentDirectory is set to the location of the executable.

    [Edit]

    If the file is in the same directory where executable is you can use the code like this:

    var directory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
    var file = Path.Combine(directory, "1.txt");
    Process.Start(file);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's this program, pdftotext, that can convert a pdf file to a text file.
I have created an object called Project that has different properties (strings and some
In a text file, there is a string I don't like this. However, when
Is there a way to include an entire text file as a string in
Is there any way to determine if a text file is currently open in
Is there a simple and lightweight program to search over a text file and
is there a way to hide columns of a buffer (text file, you know
How you can read a file (text or binary) from a batch file? There
Is there a way I can write text to a file from a certain
I have my WCF service, I've created reference to it from MSTest project. Here

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.