Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do i get the path of the executable in window console application(C#)?

Posted on 2007-11-27
1
Medium Priority
?
1,467 Views
Last Modified: 2013-12-16
Hi,

How do i find the path of the executable in a windows console application (C# code)?
I tried "Application.StartupPath".It did not work,got a compile error "the name 'application' does not exist  in this context"

Thanks..
0
Comment
Question by:Kiran_M
1 Comment
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 150 total points
ID: 20363313
Hi Kiran_M;

This will do it.
String path = Environment.CurrentDirectory;

Documentation
http://msdn2.microsoft.com/en-us/library/system.environment.currentdirectory(VS.80).aspx

Fernando
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Integration Management Part 2
Loops Section Overview
Suggested Courses

772 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