title: How can I run a .exe file from a windows service using c++
body: <p>I'm new to the windows services and visual studio. I am trying to start a .exe file from a wind32 application. The code works fine and there is no error. I am using a CreateProcess() method and checked whether the method is running properly. There is no issues in it. The .exe file which i am calling simply creates text document. When i call that .exe file from console, it works fine, it creates the file. But when I call it from the wind32 app, it does not create any file. I am using Visual studio 2019. This is my code for calling the .exe file. `</p>
  <pre><code>STARTUPINFO info;
  PROCESS_INFORMATION processInfo;
  ZeroMemory(&amp;info, sizeof(info));
  info.cb = sizeof(info);
  ZeroMemory(&amp;processInfo, sizeof(processInfo));
  
  LPCWSTR path = L&quot;C:\\HP\\...(pathofexe).exe&quot;;
  bool bSuccess = CreateProcess(path, NULL, NULL, NULL, TRUE, 0, NULL, NULL, &amp;info, &amp;processInfo);
  
  if (bSuccess)
  {
      cout &lt;&lt; &quot;Success&quot;;
  }
  else
  {
      cout &lt;&lt; &quot;Error : &quot; &lt;&lt; GetLastError() &lt;&lt; endl;
  }`
  </code></pre>