Lua for Take Command, release 1.0

May 30, 2008
I am pleased to announce the first release of my Lua plugin for JP Software's
Take Command command processor.

What is Lua for Take Command?

Lua for Take Command (LuaTC hereafter) is a plugin for Take Command
( to embed a Lua ( interpreter in the
command processor. LuaTC allows TCC batch files to take advantage of the
powerful Lua scripting language from within TCC.

Why is it different from standalone Lua?

Standalone Lua scripts do not have access to the Take Command process, so they
cannot (for example) set environment variables, or run internal TCC commands
without starting a new TCC process. However, LuaTC has direct access to the
TCC API, and can easily do these things.

A simple example, to set a variable from within Lua:

lua tcc.env["A"]="Set from Lua"

Where can I get it?

LuaTC is hosted on Google Code. The project home page is at

The binary release can be downloaded from

The sources are available from Subversion, via

svn checkout luatc

Issues and feature requests can be reported on the Issue Tracker at

Google Code Archive - Long-term storage for Google Code Project Hosting.

What documentation is there?

Documentation is in the file Lua.txt, bundled with the DLL in the binary
release, and also available in a source checkout.

What versions of Take Command and Lua are supported?

The plugin was built using Take Command 9.0 and Lua 5.1.4. The binary
distribution embeds Lua 5.1.4, but can be built with any version of Lua 5.1.
The plugin has been tested with Take Command 9, but should work with 4NT 8,
and maybe even 7, as well (earlier versions of 4NT did not have a plugin

The binary has Lua statically linked. It does not need a separate Lua DLL to
run. It can load external Lua modules, but if these are in C, they will need
to link to the Lua runtime in the plugin. This can be done, but is not trivial
to get right (see lua-users wiki: Lua Proxy Dll Four and related pages
for some details on this). Using external Lua extension DLLs has not been
tested much, and should be considered unsupported at the moment. If anyone has
any success setting this up, comments on the lua4nt wiki would be much

Why is the project called Lua4NT?

The original version of the code was written at a time when Take Command was
called 4NT, so Lua4NT seemed a good name. However, 4NT was since renamed, and
an alternative Lua interface was released by Thomas Lauer, also called Lua4NT.
When I came to release version 1.0, I decided to name the binary distribution
LuaTC, to avoid confusion. Renaming the project on Google Code is another
matter - I don't know how easy that would be, if it is even possible.


Feedback is welcome. I can be contacted either via the project issue tracker,
or by email at
Last edited by a moderator:
Similar threads
Thread starter Title Forum Replies Date
T Take Command 28: Lua reports version 5.4.0 (5.4.3 expected) Support 0
H lua Causes Take Command Tab to Exit Support 5
fpefpe Documentation LUA and friends Support 4
T Returning a value from internal Lua scripts to TCC Support 2
H Lua and lpeg Support 1
D Lua does not work on the commandline Support 5
D Fixed @Lua does not behave as documented Support 8
fpefpe How to? LUA script Support 0
fpefpe How to? Lua Examples Support 1
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2
M How to make Lua modify env-vars Support 18
Joe Caverly Internal Lua and require Support 0
jbanaszczyk LUA, tcmd.chm, TCC/LE problem Support 0
Jay Sage Executable Extension with Lua Support 5
tmaynard Invalid item name "Lua" Support 6
vefatica Help LUA Support 1
T Lua sharing data with batch files Support 2
JohnQSmith Documentation Lua Support 0
T Plugins for Lua and Idle Support 4
T VIEW only works from command line Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
J Take command does not start on Windows 10 Support 3
vefatica `Back quotes` - command line vs. batch file Support 5
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
Phileosophos Is there any way to open the Take Command options dialog from the command line? Support 7
Phileosophos Command-line Editing Shortkeys That Fail Support 6
fpefpe How to? free (internal) command Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
T How to? retain command history across reboot? Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
GermanDirk How to? EVENTLOG Command with simple User Rights not functional Support 4
Jay Sage Take Command Is Too Fast! Support 4
Jay Sage Comparison of IF with Command Group and IFF Support 6
D Open Windows 10 Photos app from command line Support 11
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
U Can not get/start Take Command gui Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
S Increasing Font Point Size in Command Tabs Support 2
mfarah Fixed The DATE command produces the wrong error message. Support 1
vefatica Command name mix-up Support 3
FreezerBurnt "Missing SETLOCAL" when initializing Visual Studio Command Prompt. Support 9
E How to? Closing desktop created by DESKTOP command Support 10
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
K Take Command fox XP? Support 7
Joe Caverly Documentation Replace internal command with LIBRARY command Support 0
fpefpe How to? command echo in title line/bar Support 2

Similar threads