Solved

How to get Exe's path directory

Posted on 1998-12-02
2
317 Views
Last Modified: 2013-11-20
How can I get the directory name of where my MFC app
is located?

so if i run
c:\apps\myapp\myapp.exe

I want to be able to get c:\apps\myapp\ during runtime.
thanks
0
Comment
Question by:vinny5
2 Comments
 
LVL 5

Accepted Solution

by:
jamoville earned 30 total points
ID: 1325664
If you use the function GetCommandLine() in your application, it will return the path of the current process.  In other words it will return c:\apps\myapp\myapp.exe.
You can then parse the myapp.exe off of the string and return the remaining:  c:\apps\myapp value you are looking for.
0
 

Author Comment

by:vinny5
ID: 1325665
thanks.. it works.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

713 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