Solved

How to get Exe's path directory

Posted on 1998-12-02
2
314 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
viewing source code from eclipse 13 107
scoreUp challenge 14 63
How to convert MFC::CString to UTF8 wchar_t* 10 211
Message not shown 5 50
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 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