title: trying to run commend on cmd throw c++ using createprocces (API)?
body: <pre><code>bool execute()
  {
      STARTUPINFO si;
      PROCESS_INFORMATION pi;
      bool flag = true;
      ZeroMemory(&amp;si, sizeof(si));
      si.cb = sizeof(si);
      ZeroMemory(&amp;pi, sizeof(pi));
      string f = "dir desktop"
      if (CmdLine.parameter != "")
      {
          LPSTR l1 = const_cast&lt;char *&gt;(f.c_str());
          CreateProcess(NULL, l1, NULL, NULL, false, 0, NULL, NULL, &amp;si, &amp;pi);
          flag = true;
          //  WaitForSingleObject(pi.hProcess, INFINITE);
  
          //  // Close process and thread handles. 
          //  CloseHandle(pi.hProcess);
          //  CloseHandle(pi.hThread);
          //}
      }
      return flag;
  }
  </code></pre>
  
  <p>I'm trying to run cmd command by visual studio.
  I'm using createprocces (API) in order to run this thing
  but I can't understand why it doesn't run anything.</p>