Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

running TCL/tk from a batch file in Windows

171 views
Skip to first unread message

Mark Tarver

unread,
Jan 30, 2024, 6:38:27 AM1/30/24
to
I want to run TCL/tk from a batch file in Windows. My event loop program loads if I click on the file eventloop.tcl and I get a widget window. What I want to do is get exactly the same thing from a batch file.

Mark

Rich

unread,
Jan 30, 2024, 11:24:37 AM1/30/24
to
Then have the batch file run:

wish.exe eventloop.tcl

somewhere within it. Note that if wish.exe is not on your PATH you man
have to give the full path to wish.exe (i.e. something like:
c:\Users\Someone\Tcl\bin\wish.exe)

Now, if you mean something else, you'll need to be more specific as to
what you really mean.

Mark Tarver

unread,
Jan 30, 2024, 12:07:40 PM1/30/24
to
I've done this as directed; but what I get is a brief flicker of a window (WISH?)
and then zip. If I click on eventloop.tcl directly I get WISH presumably with
eventloop.tcl loaded.

Mark

Ralf Fassel

unread,
Jan 30, 2024, 12:12:35 PM1/30/24
to
* Mark Tarver <dr.mt...@gmail.com>
Add a 'pause' statement after wish.exe to see error messages in the .bat
console window while debugging the batch script.

wish.exe eventloop.tcl
pause

It might be that you need to specify both wish.exe and eventloop.tcl with
full path names.

c:\ProgramFiles\tcl\wish.exe c:\users\blah\tcl\eventloop.tcl
pause

HTH
R'

Mark Tarver

unread,
Jan 30, 2024, 12:21:33 PM1/30/24
to
Hi,

I used pause and the vanishing window is a command window with the legend

C:\Users\shend\OneDrive\Desktop\Shen\S38>exec C:\ActiveTcl\bin\wish86t.exe C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl
'exec' is not recognized as an internal or external command,
operable program or batch file.

The batch file contains

exec C:\ActiveTcl\bin\wish86t.exe C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl
pause >nul

Mark

Mark Tarver

unread,
Jan 30, 2024, 12:31:29 PM1/30/24
to
I tried this

C:\ActiveTcl\bin\wish86t.exe -encoding "C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl"

which worked BUT I got a command window and a TCL console for free which I did not
want. :(

Mark

Ralf Fassel

unread,
Jan 30, 2024, 1:13:58 PM1/30/24
to
* Mark Tarver <dr.mt...@gmail.com>
| I tried this
>
| C:\ActiveTcl\bin\wish86t.exe -encoding "C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl"

Note that an argument like 'utf-8' is required after -encoding, not
directly the file name (this might be why you get a TCL console, not
sure).

| which worked BUT I got a command window and a TCL console for free
| which I did not want. :(

A .bat *always* gets a command window, which you can set to "minimized
on startup" in the properties of the .bat, but AFAIK it will always be there.

Maybe you want a desktop link to the .tcl file instead?

R'

Mark Tarver

unread,
Jan 30, 2024, 7:05:13 PM1/30/24
to
utf worked - getting rid of console :)). The command window is frozen. :((
I wanted to use the bat file to start TCL/tk with the event loop (process A)
and then start another process (a REPL) in the command window (process B).
Putting process A first blocks the REPL and process B first blocks TCL. I
need something which allows both processes to go through.

Mark


et99

unread,
Jan 30, 2024, 8:35:16 PM1/30/24
to
On 1/30/2024 3:38 AM, Mark Tarver wrote:
> I want to run TCL/tk from a batch file in Windows. My event loop program loads if I click on the file eventloop.tcl and I get a widget window. What I want to do is get exactly the same thing from a batch file.
>

Have you tried:

start /min <path>\wish <path>\eventloop.tcl

Mark Tarver

unread,
Jan 31, 2024, 12:59:32 AM1/31/24
to
I'll give that a go. Another possibility is to start process B from TCL
by putting a preamble into eventloop.tcl. I've found 'exec':)

exec "C:/Users/shend/OneDrive/Desktop/Shen/S38/sbcl-shen.exe"

but no command window appears. Oddly the REPL of the external
program (process B) is called repeatedly until an overflow occurs.

What I'm trying to do is obtain the result I obtain now by clicking on eventloop.tcl (process A)
and then clicking on shen-sbcl.exe (process B), but by clicking on only one icon.

Mark

Mark Tarver

unread,
Jan 31, 2024, 1:27:09 AM1/31/24
to
Bingo; START worked! Thanks guys.

Mark
0 new messages