What I would like is to have the process start but have the input and output all be in the same console.
if(CreateProcessWithLogonW(user,domain, pass, LOGON_WITH_PROFILE, NULL, cmd, 0, 0, 0, &sa, &pe))
{
printf("[~] Process spawned with PID %X\n", pe.dwProcessId);
}
else
{
printf("[!] Failed to create process. Error Code: %X\n", GetLastError());
}
When I use this code it creates a whole new window instead of having it in the same window. Is there a way to unset the "CREATE_NEW_CONSOLE" flag because even when I set it to 0 it still creates a new console.