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

Posted by Jamie Keeling on Stack Overflow See other posts from Stack Overflow or by Jamie Keeling
Published on 2010-04-29T11:35:47Z Indexed on 2010/04/29 11:37 UTC
Read the original article Hit count: 641

Filed under:
|
|

Hello,

I am running two processes,Process A is opened by Process B using the following example:

    createProcessHandle = CreateProcess(
TEXT("C:\\Users\Jamie\\Documents\\Application\\Debug\\ProcessA.exe"),
                    TEXT(""),
                    NULL,
                    NULL,
                    FALSE,
                    0,
                    NULL,
                    NULL,
                    &startupinfo,
                    &process_information
                    );

As you can see the Process is reliant on the path given to it, the problem I have is that if I change the location of my ProcessA.exe (Such as a backup/duplicate) it's a tiresome process to keep recoding the path. I want to be able to make it run no matter where it is without having to recode the path manually.

Can anybody suggest a solution to this?

© Stack Overflow or respective owner

Related posts about winapi

Related posts about c