title: How to start a w3wp.exe work process for specific application pool from command line?
body: <p>IIS will automatically start a work process(w3wp) for a specific application pool while running an application (that means web request).  May I start a w3wp for a specific application pool from the w3wp command line?</p>
  <p>My purpose is to monitor the winapi's activities of this web application. To achieve this goal, I need to know how to start a w3wp.exe work process for a specific application pool from command line.<br />
  To make you a sense of my purpose, I give a brief explication. Now I own an Api named <code>CreateTargetProcessWithDll</code> which requires two parameters, one is target process path, and another is dll path. Using this api will start target process and inject dll into this target process. The problem is that the dll is injected into target process(appcmd), not into work process(w3wp) started by target process.</p>
  <p>Then, I try to directly pass w3wp command line to <code>CreateTargetProcessWithDll</code> for starting a work process for a specific application pool.  That is
  <code>w3wp -s 1668934745 -h C:\\Windows\\System32\\inetsrv\\config\\applicationHost.config -w \\?\\C:\inetpub\wwwroot\wss\VirtualDirectories\26670\web.config</code>
  which can start a w3wp, but it is only a single process, does not link the specified apppool.</p>
  <p>So how to start a work process from w3wp command and link this process with a specific apppool.</p>