// test with: echo %PATH% #include #include int main() { #ifdef __linux__ char *path = "/bin/sh"; #elif _WIN32 char *path = "c:\\windows\\system32\\cmd.exe"; #endif char * const argv[] = {path, NULL}; char * const envp[] = {NULL}; execve(path, argv, envp); }