?
Solved

locating application *.exe

Posted on 1999-10-13
1
Medium Priority
?
219 Views
Last Modified: 2013-11-20
I need my application MyApp to be able to locate the directory where it is installed (i.e., the directory where MyApp.exe is located). How do I do this ? - obviously, without searching the entire hard drive.
0
Comment
Question by:olegsp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
VinExpert earned 200 total points
ID: 2125351
Hi,
U can use the following code to get Ur exe path

char ExeFileName[MAX_PATH];
DWORD pathLength;
pathLength = ::GetModuleFileName(NULL, ExeFileName, sizeof(ExeFileName));

U will get the path in  ExeFileName;

Hope it helps.
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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

719 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