Program Startup Folder
-
How can I determine the folder where the .exe file is saved? I must do this without the registry due to goofy security restrictions on the PC where this app will run.
-
TCHAR lpszPath[MAX_PATH] = {0}; DWORD dwResult = ::GetModuleFileName(AfxGetInstanceHandle(), lpszPath, MAX_PATH);
-
How can I determine the folder where the .exe file is saved? I must do this without the registry due to goofy security restrictions on the PC where this app will run.
You're asking for two different things there. I take "startup folder" to mean the "current directory" of the process, which doesn't have to be the same as the dir where the EXE is. If you want the current directory, call
GetCurrentDirectory()
. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD -
You're asking for two different things there. I take "startup folder" to mean the "current directory" of the process, which doesn't have to be the same as the dir where the EXE is. If you want the current directory, call
GetCurrentDirectory()
. --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD