#include<stdio.h>
#include<windows.h>

int main()
{
    STARTUPINFO si = { sizeof(si)};
    PROCESS_INFORMATION pi = {0};

    // create process
    if ( CreateProcess("C:\\Windows\\System32\\cmd.exe",NULL,NULL,NULL,FALSE,CREATE_NO_WINDOW,NULL,NULL,&si,&pi))
    {
        printf("Process created successfully\n");
        printf("Process Id: %lu\n",pi.dwProcessId);
        printf("Thread Id: %lu\n",pi.dwThreadId);

        
	//close handle ( notepad.exe)
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);

    }
    else
    {
        printf("Process not created, ERROR: %lu\n",GetLastError());
        return 1;
    }

    return 0;
}
