Locate the directory in which the executable EXE process is running

Possible duplicate:
How to get the application executable name in Windows (C ++ Win32 or C ++ / CLI)?

I can find the directory where this process is running using GetCurrentDirectory(), but what about searching the directory where executabke is located?

+5
source share
2 answers

In Visual C ++, we use

CString m_sAppFolder =  __targv[0] ;

which returns a string like "C: \ blah \ blah \ executable_name.exe"

-2
source

All Articles