winapi - How to find working directory which works between different computers. - C -


i running 2 processes,process opened process b using following example:

    createprocesshandle = createprocess( text("c:\\users\jamie\\documents\\application\\debug\\processa.exe"),                     text(""),                     null,                     null,                     false,                     0,                     null,                     null,                     &startupinfo,                     &process_information                     ); 

as can see process reliant on path given it, problem have if change location of processa.exe (such backup/duplicate) it's tiresome process keep recoding path. want able make run no matter without having recode path manually.

can suggest solution this?

edit: not have access path environment variable

there 2 options.

  1. use relative path.
  2. put directory in path environment variable. in case, use lpcommandline, not lpapplicationname.

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -