Solved

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

Posted on 2007-11-27
1
1,442 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 63

Accepted Solution

by:
Fernando Soto earned 50 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
application restarter  - for an exe that hangs 9 28
SQL Help 27 45
Help with exporting to excel 4 28
JSON  parse help 7 27
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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