[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua ActiveX Scripting engine
- From: "steve donovan" <steve.j.donovan@...>
- Date: Tue, 19 Aug 2008 11:55:56 +0200
> On 14/08/2008 16:32, Paul Moore wrote:
>> I'm sure I recall a long while ago, an ActiveX scripting engine for
>> Lua (basically, allowing Lua to be used in place of VBScript or
>> JScript on Windows). However, I can't seem to find it any more -
>> LuaCOM doesn't seem to include this, and I can't see anything else
>> which looks appropriate on the Lua wiki.
LuaCOM can access all the usual automation interfaces which WSH uses,
except for the basic WScript object. So one can really do all that a
typical WSH script can do anyway.
local sh = luacom.CreateObject('Wscript.Shell')
sh:Run 'notepad' -- sensible defaults!
> n = luacom.CreateObject('WScript.Network')
> = n
> = n.ComputerName
> = n.UserName
> = n.UserDomain
Some things aren't entirely obvious from the documentation; Item is
described as a property but is called like function:
> env = w:Environment()
> = env:Item 'PATH'
> = env:Count()