Click to See Complete Forum and Search --> : How to get app's starting directory


Jongsik Chun
September 15th, 1999, 09:37 PM
How can I get application's starting directory?

September 15th, 1999, 10:26 PM
CString GetExePath()
{
CString path;
LPSTR buf = path.GetBuffer(_MAX_PATH);

//Get exe path
VERIFY(::GetModuleFileName(NULL, buf, _MAX_PATH));

path.ReleaseBuffer();
// path.MakeLower();

return path.Left(path.ReverseFind('\\'));
}