Borland C++ Compiler 5.5のspawnvp関数の使用例を示します。command.comを/cオプションで起動しdirを取ります。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <process.h>
void main(void)
{
char *a[20];
int d;
a[0] = (char *)malloc(50);
a[1] = (char *)malloc(50);
a[2] = (char *)malloc(50);
a[3] = NULL;
strcpy(a[0],"command.com");
strcpy(a[1],"/c");
strcpy(a[2],"dir");
d = spawnvp(P_WAIT,"command.com",a);
printf("return value=%d\n",d);
}