Execute another program in C++

前端 未结 4 1344
失恋的感觉
失恋的感觉 2020-12-18 02:09

I want to remotely execute another application from my C++ program. So far I played along with the CreateProcess(...) function and it works just fine.

The problem ho

4条回答
  •  醉梦人生
    2020-12-18 02:33

    Launching programs and counting on PATH in any way is considered insecure coding. System PATHs may get polluted with locations that aren't secured properly such as a network drive. The best way to launch an application is to launch the executable from exactly where it stands and set the CWD to the location of the executable as installed. Otherwise you could be launching malicious code.

    Most likely some combination of information from here will help get the location correctly: Detecting installed programs via registry

    Greg

提交回复
热议问题