///////////////////////////////////////////////////////////////////////////// // Creation 16/12/2003 // // // SPAWN.C // ------- // // // Sylvain MARECHAL - sylvain.marechal1@libertysurf.fr ///////////////////////////////////////////////////////////////////////////// // // Spawn usage // ///////////////////////////////////////////////////////////////////////////// #include #include #include int main() { char szPathCmd[MAX_PATH]; // Retrieve winnt\system32 path GetSystemDirectory( szPathCmd, MAX_PATH ); strcat( szPathCmd, "\\cmd.exe" ); // start cmd, which in turn start notepad // see also P_NOWAIT, if you dont want to wait the end spawnl( P_WAIT, szPathCmd, szPathCmd, "/c", "notepad.exe", NULL ); }