I\'m trying to use CreateProcess
to start a child process, however I keep getting error 2
, which, according to the documentation is file not found.
test.exe
is never being looked up in the directory that the calling exe
lives in. It is being looked up in the current directory which is a per-process path variable. Maybe the current directory is not pointed to where test.exe
lives. You should also never rely on that because it can change arbitrarily (for example by using the file dialogs, or when the parent process changes it).