Working directory of a process
-
Do you know how to get the working directory of a process? Do I need to access some shell objects in order to get the working directory of a process? Thanks all.
The current directory of your own process can be retrieved with
GetCurrentDirectory
. Is that what you were looking for? -
Do you know how to get the working directory of a process? Do I need to access some shell objects in order to get the working directory of a process? Thanks all.
Mike's right - though sometimes you may want to get the dir in which your app (or another) resides, in order to _make_ that the working dir (we don't always have a choice as to how our apps are invoked via shortcuts etc.). GetModuleFileName will return the full path to the location of the exe or dll, and you can go from there.