#include #include int main() { STARTUPINFO si = { sizeof(si)}; PROCESS_INFORMATION pi = {0}; const char *my_dir = "C:\\Users\\John\\Music\\"; if(CreateProcess("C:\\Windows\\System32\\notepad.exe",NULL,NULL,NULL,FALSE,0,NULL,my_dir,&si,&pi)) { printf("Parent process id: %lu\n",GetCurrentProcessId()); printf("process created successfully with id %lu\n",pi.dwProcessId); //close handles CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } else { printf("Error: %lu\n",GetLastError()); return 1; } return 0; }