I'm surprised that no one mentioned the system-standard method for determining a process's executable. The string should be accessed during startup and saved elsewhere if needed because it might not persist.
PPIB ppib;
char *ptr;
// get the Process Information Block
DosGetInfoBlocks(0, &ppib);
// get a pointer to the environment
ptr = ppib->pib_pchenv;
// loop through the environment strings to find
// the null string that terminates it
while (*ptr)
ptr = strchr(ptr, 0) + 1;
// the exe's fully-qualified filename starts at the next character
ptr++;