_cmdname

get the executing program's pathname

Synopsis:

#include <process.h>
char *_cmdname( char *buffer );

Description:

The _cmdname() function obtains a copy of the executing program's pathname, and places it in buffer.

Returns:

If the pathname of the executing program cannot be determined then NULL is returned; otherwise the address of buffer is returned.

See also:

getcmd()

Examples:

#include <stdio.h>
#include <process.h>

void main()
  {
    char buffer[PATH_MAX];

    printf( "%s\n", _cmdname( buffer ) );
  }

Classification:

WATCOM

Systems:

All (except Netware, DOS/PM)