Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find what directory the running process EXE is stored in [duplicate]

Tags:

c++

winapi

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

I can find what directory the process is running in using GetCurrentDirectory(), but what about finding the directory the executabke resides in?

like image 595
Mr. Boy Avatar asked Jul 29 '10 16:07

Mr. Boy


1 Answers

GetModuleFileName or GetModuleFileNameEx.

like image 154
Jerry Coffin Avatar answered Nov 15 '22 00:11

Jerry Coffin