Re: Current EXE path

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Dimwit Flathead wrote:
William GS wrote:

Hello everybody. How can I obtain the current EXE path?

Thanks in advance,
William GS


Look at GetCurrentDirectory()

-DF

GetCurrentDirectory does not provide the EXE path!

For that you must use GetModuleFileName.

--
Scott McPhillips [VC++ MVP]

.



Relevant Pages

  • Re: Dateiauswahl als Kombinationsfeld
    ... ob mit GetCurrentDirectory oder GetModuleFileName ... Vor Starten hat der Benutzer mehrere Dateiten (File1.txt, File2.txt, ... Next by Date: ...
    (microsoft.public.de.vc)
  • Re: Current EXE path
    ... Look at GetCurrentDirectory() ... For that you must use GetModuleFileName. ... My apologies! ... I misunderstood that he wanted the current directory for the given process! ...
    (microsoft.public.vc.mfc)
  • Re: Application directory
    ... GetModuleFileName() ... running in from within the application itself (other than by calling ... 'GetCurrentDirectory' at application start-up) ... England ...
    (microsoft.public.vc.mfc)