in reply to #exec in SSI

IIS expects the cgi code to send HSE_STATUS_PENDING at the end of the code to signal completion.

Look that symbol up. I'll bet it is zero (0).

I've used SSI on IIS many times, and a simple   exit(0); at the end of the script has sufficed.

I haven't been able to track down the source, so this may be superstition, but I've heard that any scripts you execute this way must be in virtual directories, and those directories must be configured to allow script execution. This is all I ever do, and I've had no problems.