|Think about Loose Coupling
Have you checked the security permissions for this file? IIS will use the IUSR_<servername> account when your CGI script is run. Normally the IUSR_ account only has read access to files.
Try setting the file security to Everyone / Full Control to see if that helps. You can change the security again later to remove the Everyone group and use the IUSR_ account explicitly.