Enabling Tcl in Microsoft IIS

From news:comp.lang.tcl , message [email protected] , Darren New writes on how to enable one to use Tcl CGI scripts:

Go to the Internet Information Services console. (Under "Administrative Tools" perhaps.) Open the "Default Web Site" thing, and find "Scripts" under there (or whatever dir you want the CGI dir to be). Right-click on "Scripts" and pick "Properties". The first tab is "Virtual Directory." Near the bottom is "Configuration" and "Execute Permissions". Set "Execute Permissions" to "scripts only" or "scripts and executables". Click "Configuration" and go to the "App Mappings" tab. Say "Add" and fill in

   C:\TCL\BIN\Tclsh83.exe "%s" 

(Or wherever the interpreter is).

Pick an extension. I use ".tsh" (without the quotes) for "Tcl Shell", as opposed to a Wish program. Pick whatever you like.

If you don't put the "%s" there, tclsh83 doesn't get the name of the script to run. Wonderfully undocumented. Click "Script Engine". Set the verbs if you want. Click "check that file exists" if you want.

http://localhost/Scripts/xyz.tsh will now invoke xyz.tsh in a tclsh83 interpreter with everything set up for CGI.

Hope this is what you're looking for. The basic answer is to go to "App Mappings" for a script directory and associate ".tcl" with tclsh83.exe "%s".


Another frequent request deals with using Tcl as a scripting language alternative to Visual Basic on the server side. To enable Tcl as a server side scripting language in IIS, one must install a Tcl Active Script engine. See TclScript and tcom which provide experimental implementations.


TclControl and TclBridge might also be useful.


Doesn't perl from ActiveState automatically enable perlscript in IIS? If so, why can't ActiveState do the same for tcl?

JH: It is possible, but we wouldn't want to do it without someone in the community fully testing that it works. If someone wishes to do that, we would certainly consider adding this as an install option.


When installing wikit under IIS I found out that at least my version of IIS did not support PATH_INFO variable which is essential for wikit application (and propably to many other script application as well). This can be fixed by issuing the following administration commands:

  C:\>cd \inetpub\adminscripts
  C:\Inetpub\AdminScripts>adsutil set w3svc/AllowPathInfoForScriptMappings True

More info at MS site http://support.microsoft.com/default.aspx?scid=kb;en-us;184320

The other necessary step was to map suitable extension (e.g. .tkd) to wikit application using IIS control panel:

  Extension .tkd -> c:\-> "C:\Program Files\Tcl\bin\tclkitsh.exe" wikit.kit %s 

This mapping maps all script references to .tkd databases to wikit application (using tclkitsh.exe, naturally), thus enabling to run any amount of wikit databases on the same server. URL reference to wikit root looks now like this:

  http://myservername/scripts/dilbert.tkd/

Roy Nurmi


APN The SCGI page describes an ISAPI extension that can be used in conjunction with the SCGI script to deliver Tcl scripting support. I believe this is by far the highest performance Tcl scripting option for IIS. The Woof! Tcl web application framework also supports IIS.