Running a tcl script from a command line on Windows XP

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Running a tcl script from a command line on Windows XP

  • Creator
    Topic
  • #50166
    Klaus Wais
    Participant

      I would like to run a tcl script from a command line on Windows XP outside of the IDE.

      Has anybody tried this before with the tcl that comes with the qdx5.6.

      I’m struggling with the setup of environment and path variables for the tcl.

    Viewing 2 reply threads
    • Author
      Replies
      • #65080

        Running a tcl script from the command line is a relatively straightforward process.

         * Puts some tcl commands in a file. (ex. test.tcl)

         * From the command line: tcl test.tcl

        -- Max Drown (Infor)

      • #65081
        Rob Abbott
        Keymaster

          A batch file wrapper helps if you haven’t setroot from whatever environment you are running in:

          Code:

          @echo off
          call setroot (optional args)
          tcl myscript.tcl

          Rob Abbott
          Cloverleaf Emeritus

        • #65082
          garry r fisher
          Participant

            Hi,

            Two other options you could use.

            1. On windows change the extension to .htc. This create a Tcl batch file that invokes the Tcl interpreter on runtime. So instead of:

            tcl test.tcl

            You could use

            test.htc

            2. The other way is to create a standalone application from your script. I use freewrap for this which is available freewrap.sourceforge.net/ and wraps your Tcl scrips into a single file binary executable i.e test.tcl becomes test.exe.

            Option 1 would be best for Cloverleaf apps provided you have hciroot set. Option 2 is for more complex scripts that don’t rely on the Cloverleaf environment.

            Regards

            Garry

        Viewing 2 reply threads
        • The forum ‘Tcl Library’ is closed to new topics and replies.