get the executing program's pathname
#include <process.h> char *_cmdname( char *buffer );
The _cmdname() function obtains a copy of the executing program's pathname, and places it in buffer.
If the pathname of the executing program cannot be determined then NULL is returned; otherwise the address of buffer is returned.
#include <stdio.h>
#include <process.h>
void main()
{
char buffer[PATH_MAX];
printf( "%s\n", _cmdname( buffer ) );
}
WATCOM
All (except Netware, DOS/PM)