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

x
?
Solved

How to get Exe's path directory

Posted on 1998-12-02
2
Medium Priority
?
329 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 120 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

876 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