How to run a Tcl script in Windows

Tcl/Tk

Download & Install ActiveTcl

First and foremost, go to http://www.activestate.com/activetcl and download ActiveTcl for Windows

or go to or http://sourceforge.net/projects/tcl/ and download and install Tcl from sources (advanced users only).

Run Tcl Scripts

There are three approaches to starting scripts in Tcl: source, shortcuts, and file associations.

  1. The first way is to launch the Wish application and use “source”. This is the best way to debug scripts. Not useful for your average user.
  2. The second alternative is to create an icon or shortcut. The binary release uses this technique for the widget tour icon.
    The command line for the icon should be something like:
    C:\\Program Files\tcl\bin\wish.exe C:\myscript.tcl
  3. The third way to launch a Tcl script is to create a file type association for the extension “.tcl” (or “.tk”). Using the File Manager (Windows Explorer> My Computer), create a new file type for .tcl, and add an “open” action. The command for the action should be something like:
    “C:\\Program Files\tcl\bin\wish.exe” “%1”
    Once you have set up the association, you will be able to double click on script files in File Manager to launch the app.
    Note that if either the location of wish or the location of the script contains spaces in any of the file names, you must enclose the name in quotes.
    For example: “C:\\Program Files\tcl\bin\wish.exe” “C:\\Program Files\myscript.tcl”
    Also, please note, I don't know where tcl is installed on your system. “C:\\Program Files\tcl\bin\wish.exe” is just a guess.

from http://www.tcl.tk/faq/tclwin.htm modified by tonybaldwin

tonybaldwin 2012.01.03.19.27