C++ [Windows] Path to the folder where the executable is located [duplicate]

Use GetModuleFileName to find out where your exe is running from.

WCHAR path[MAX_PATH];
GetModuleFileNameW(NULL, path, MAX_PATH);

Then strip the exe name from path.

Leave a Comment