lagu2653 - 2008-10-31

Language: Native VC++

This page shows how to retrieve the command line a certain process was started with http://win32.mvps.org/processes/remthread.html if you know the PID. We have a runtime, a .exe-file. Several instances of the same file will be launched. The only difference between them is the port they’re connected to. The runtime is a CoDeSys runtime which we don’t have the source code for. The application is a CoDeSys (PLC IEC 61131-3) application which logs in to http://localhost: number>. (The CoDeSys ENI server occupies the localhost address so IIS cannot run if the ENI server is running.) We want to retrieve the command line arguments which were used when launching each runtime. So the question is: How do you do that if the only thing which differs them is the port of localhost they’re logged in to? How do you find the PID of the process which uses http://127.0.0.1:1200, http://127.0.0.1:1201, http://127.0.0.1:1202, http://127.0.0.1:1203, etc. etc?