Version 5 of Enabling Tcl in Microsoft IIS

Updated 2002-09-23 06:18:20

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:\PROGRA~1\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 VisualBasic 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.

TCLBridge is a powerful component designed to allow seamless integration of Tcl/Tk and any ActiveX capable language (such as Visual Basic 6). This component is fully multi-threaded and thread-safe (each interpreter has it's own thread). Additionally, full Tcl/Tk stubs support has been added (build 5000+). This component should work with any version of Tcl/Tk 8.3.2 or higher (including TclPro 1.4.1 or higher). Multiple Tcl interpreters can be easily created, used, and destroyed. In addition, there is a simple yet powerful facility that allows Tcl to invoke YOUR custom ActiveX components. You simply specify the Tcl command name to add, the instance or progID of the COM object to call, the method name to call, and the "clientData" (or cookie) you want to receive when called by the specified Tcl interpreter. In short, Tcl commands are transparently mapped to COM method calls that you control in a fully reentrant, thread-safe manner. Command arguments are handled automatically either as one long string or as separate strings (can be toggled dynamically). Please see the official web site for more information and complete documentation [L1 ]. Also includes the following:

1. Full Tk support.

2. Stable asynchronous evaluation.

3. Special debugging support, such as the ability to use multiple debuggers at once, such as Visual Basic and TclPro (a very powerful combination) and other diagnostic functionality.

4. TCL2COM, which allows Tcl scripts to utilize any ActiveX object that supports automation using TCLBridge.

5. TCL2ASP, a prototype component which allows easy integration with Microsoft IIS using TCLBridge.

6. VBS2TCL, a prototype component which allows easy integration with VBScript. Due to the limitations of VBScript (MSKB Q197957), TCLBridge does not work with VBScript without VBS2TCL.

7. More features coming soon [L2 ]...