NTLua Online

NTLua  Scripting Windows NT Administration and Logon
Version 2


NTLua is a console application to create Windows NT administration and logon scripts.

It can be used as a Logon scripting tool. Copy the "ntlua.exe" file to the NTLOGON share, 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 and XP). 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. If the text is greater than the buffer will automatically pause (an automatic "more").

The interactive console has some special features inherited from LuaCmd ( http://www.tecgraf.puc-rio.br/luacmd ).


Usually you will execute:

    ntlua somescript.lua arg1 arg2 arg3 ...

Arguments are passed to the Lua environment as a table "arg[1]", "arg[2]", "arg[3]" and so on, "arg.c" contains the number of arguments. Also the script file name can be used inside the script accessing the variables SCRIPT_FILE_NAME, SCRIPT_NAME, SCRIPT_PATH (filename = path / name).

If executed without a script it will try to load a script called "ntlua.lua" if it fails to find it , it starts the console.


Logon Script - ntlua.lua

Domain User Creation - mkuser.lua

Domain User Removal - rmuser.lua


26 Apr 2002 - Version 2.1.2 - Changed the behavior of the functions: version and os. They also now supports 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 me. Please, specify platform, compiler, version you are using in your message.

Looking for Lua? http://www.tecgraf.puc-rio.br/lua.

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


Antonio E. Scuri (messages to [email protected], home page in Portuguese at http://www.tecgraf.puc-rio.br/~scuri).

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


See the Copyright Notice, is the same copyright used by Lua.


The program source code, HTML pages, samples, and pre-compiled binaries:

ntlua212src.zip (source code, html, makefiles) - 120Kb
(binary only) - 80Kb

ntlua10.zip (binary only) - 100Kb

About NTLua Online

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

The manual is also available in Windows HTML Help format (NTLUA.CHM 20Kb).

This manual was created using the manual creation toolkit WebBook, which can be found at http://www.tecgraf.puc-rio.br/webbook.


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