Are you entirely sure that you haven't missed a \ for example?
This works just fine here, using DJGPP
Code:
#include <stdio.h>
#include <process.h>
void p1 ( void ) {
int res = spawnl( P_WAIT,
"c:\\winnt\\system32\\ping.exe",
"c:\\winnt\\system32\\ping.exe",
"127.0.0.1", NULL );
printf( "Res=%d\n", res );
}
void p2 ( void ) {
char *cmd = "c:\\winnt\\system32\\ping.exe";
char *par = "127.0.0.1";
int res = spawnl( P_WAIT, cmd, cmd, par, NULL );
printf( "Res=%d\n", res );
}
int main ( ) {
p1();
p2();
return 0;
}