c++ - CreateProcess() lpCurrentDirectory has no effect -


i want start process (exe file) , if append full path command line (lpcommandline param) fine if set lpcurrentdirectory [startdir] system says:

error_file_not_found 

start process:

createprocessa(null,                    // no module name (use command line)             &command[0],                        // command line             null,                               // process handle not inheritable             null,                               // thread handle not inheritable             false,                              // set handle inheritance false             create_new_console,                 // no creation flags             null,                               // use parent's environment block             [null] or [startdir],               // use parent's starting directory              startupinfo,                        // pointer startupinfo structure             processinfo)                        // pointer process_information structure 

-> in folder other dlls , exe want start

why doesn't work?

thx!

no, won't work. new process won't started directory "current" directory during start. instead, current directory set once process has started.

if want process start in particular directory, need use setcurrentdirectory or 1 of more or less portable variants thereof (_chdir example).


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -