Here is your code, just copy your exe path to buff, for each of your exes, here I used notepads as exes, only when you close those notepads or exes closes it will not exit, I waiting for those to complete.
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
void _tmain( int argc, TCHAR *argv[] )
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
TCHAR buff[1024];
ZeroMemory( buff, sizeof(buff) );
wcscpy(buff,L"C:\\Windows\\System32\\notepad.exe");
if( !CreateProcess( NULL, buff,
NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) )
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
}
if( !CreateProcess( NULL, buff,
NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) )
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
}
if( !CreateProcess( NULL, buff,
NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) )
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
}
WaitForSingleObject( pi.hProcess, INFINITE );
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}