NTLua is a console application to create Windows NT administration and logon scripts. It also has a Lua module that can be loaded by "require" in other Lua applications that use the LuaBinaries distribution.

It can be used as a Logon scripting tool. Copy the "ntlua.exe" and DLLs to the NTLOGON share folder in your logon server, edit a file called "ntlua.lua" in the same place, and configure the user logon script to "ntlua.exe". The "ntlua.lua" script will be automatically loaded at logon time.

NTLua runs only in Windows NT systems (4.0, 2000, XP, 2003 and Vista). It does not run in Windows 9x/Me.

The NTLua script log has a blue background. Normal text is printed in white, errors are printed in red, and warnings are printed in yellow.


ntlua [options] [script [args]]
Available options are:
  -e stat execute string 'stat'
  -l name require library 'name'
  -i enter interactive mode after executing 'script'
  -v show version information
  -- stop handling options
  - execute stdin and stop handling options
  if no options are used, it will try to load a script called "ntlua.lua" if it fails to find it, it starts the interactive mode.

The console is the same application of the stand alone Lua interpreter with an already loaded the NTLua module and a few new features considering it runs on Windows.



02 Ago 2007 - Version 3.0 - Migration to Lua 5.1. New name space "ntlua". Changed table parameter format of cacls function. New writeregbin function. New parameter to wait function.
26 Apr 2002 - Version 2.1.2 - Changed the behavior of the functions: version and os. Also they now support Windows XP.
19 Apr 2002 - Version 2.1.1 - New funtions: readinisection, readinikeys, readinisections. (Thanks to Juan Duarte for the suggestion.)
05 Oct 2001 - Version 2.1- Now only invalid parameter errors will abort scripts. Some startup code were improved. The wait param in start function is now optional. df now returns more precise values and accepts a unit division.
25 Oct 2000 - Version 2.0
22 Feb 1999 - Version 1.0 (only a logon script tool, this version runs also under Windows 9x)

To Do's

  • Windows API - Services, Process (List and Kill), Shell DDE/Shell Link, Shell Special Folders
  • AppActivate / SendKeys - to control an application.
  • LogToFile - log output to a file.


If you interested in help, send comments, critics, suggestions, etc to [email protected]. Please specify system and NtLua version you are using in your message.

A new version annoucement list is available at LuaForge: http://lists.luaforge.net/mailman/listinfo/ntlua-announce.

The NTLua page at LuaForge is available at: http://luaforge.net/projects/ntlua/.

This program is free for every usage. The source code is public available. The author does not offer any guaranties, nor support, etc...

Looking for Lua? http://www.lua.org/.


Antonio E. Scuri (http://www.tecgraf.puc-rio.br/~scuri).


See the Copyright Notice, is the same copyright used by Lua and other Tecgraf libraries.

The code for changing access control lists was used from the Platform SDK tool cacls, developed by Dave Mont, and it is copyright of Microsoft.


The program source code, HTML pages, samples, and pre-compiled binaries are available at LuaForge:



This page is available at http://www.tecgraf.puc-rio.br/~scuri/ntlua

The documentation is also available in Windows HTML Help format.

The HTML navigation uses the WebBook tool, available at http://www.tecgraf.puc-rio.br/webbook.


.. "Make it Reusable, Make it Simple, Make it Small" ...