Got “The system cannot find the file specified” when I run NETSH from CreateProcess but it works ok on Command Prompt?

后端 未结 2 1705
灰色年华
灰色年华 2021-01-05 14:53

I have an NT service that calls a console program written in Delphi 7, let\'s call it failover.exe that in turn calls NETSH using a pr

2条回答
  •  盖世英雄少女心
    2021-01-05 15:36

    The "cannot find the file specified" error may also occur if an implicitly loaded DLL required by the executable is not available. In this situation, that is the most likely cause - some essential DLL is not being found when netsh.exe is being run in a non-interactive context.

    Use Process Monitor (available for download from Microsoft's web site) to record the file system operations that are taking place during the attempt. Look for file not found errors either in the context of your service process or in the context of the netsh.exe process.

提交回复
热议问题