Microsoft KB Archive/226518

= PRB: Server Side Include #exec Directive and Console Handle Problems =

Article ID: 226518

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft Internet Information Server 3.0
 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q226518



SYMPTOMS
The Server Side Include (SSI) capability of Internet Information Server (IIS) provides support for the #exec directive to launch applications whose output will be included in the SSI file's output. However, there may be issues with how the stdio handles work for certain applications. For instance, by default the following line will create the output file c:\out1.txt but it will be empty.



CAUSE
The same infrastructure that launches CGI applications for IIS is used to launch commands for the #exec directive in SSI scripts. By default these processes are not launched with a console. Therefore there are issues that arise when console handles are assumed to exist as in the case above.



RESOLUTION
Here are two possible work arounds:


 * 1) If you have access to the source code for the application you are launching, you can have it call AllocConsole to ensure that the console stdio handles are available.
 * 2) You can configure IIS to create a new console for all processes launched by the CGI infrastructure by setting the CreateCGIWithNewConsole property in the metabase to True.



STATUS
This behavior is by design.

