Which compiler are you using?
Post your latest code.
spawn is an archaic DOS interface, it probably doesn't understand long filenames (it doesn't here).
Code:
#include <iostream>
#include <fstream>
#include <process.h>
#include <windows.h>
using namespace std;
int main()
{
// with long filename, nada, zip, zilch
// spawnl( P_WAIT, "\"c:\\Program Files\\PFE\\pfe32.exe\"", NULL );
// with substituted 8.3 equivalents, success
spawnl( P_WAIT, "c:\\Progra~1\\PFE\\pfe32.exe", NULL );
// or if you're writing a win32 program, use a win32 API and it's all good
char szPath[] = "C:\\Program Files\\WinZip\\winzip32.exe";
PROCESS_INFORMATION pif; //Gives info on the thread and..
//..process for the new process
STARTUPINFO si; //Defines how to start the program
ZeroMemory(&si,sizeof(si)); //Zero the STARTUPINFO struct
si.cb = sizeof(si); //Must set size of structure
BOOL bRet = CreateProcess(
szPath, //Path to executable file
NULL, //Command string - not needed here
NULL, //Process handle not inherited
NULL, //Thread handle not inherited
FALSE, //No inheritance of handles
0, //No special flags
NULL, //Same environment block as this prog
NULL, //Current directory - no separate path
&si, //Pointer to STARTUPINFO
&pif); //Pointer to PROCESS_INFORMATION
}