0

I have written a small Windows service in C++ that periodically runs .cmd file via ShellExecuteEx. Sometimes happens a issue: ShellExecute returns true - everythings is ok - but no child cmd.exe process was started and SHELLEXECUTEINFO.hProcess is NULL although I specified SHELLEXECUTEINFO.fMask = SEE_MASK_NOCLOSEPROCESS. Even it didn't start a simple.cmd: date /T >> file.txt

Normally the .cmd files contain a php command to run a php script.

This issue occured when the whole system runs approx 100 child cmd.exe processes through this Windows service that is run under NETWORK_SERVICE account. Manually from the Explorer I was able to run such cmd process.

Is there a Windows System limit of maximum processes started by ShellExecuteEx ?

jan-vavra
  • 11
  • 1
  • 3
  • One has to wonder why you're using *shell* functions from inside of a service. – Damien_The_Unbeliever Nov 10 '15 at 09:07
  • I don't know whether ShellExecuteEx has any explicit limits, but I second Damien's objection to using it in a service. The first thing to try is using CreateProcess instead and see if that fixes the problem. – Harry Johnston Nov 10 '15 at 22:36

0 Answers0