lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Mar 12, 2008 at 3:26 AM, Rolf <rb@san.rr.com> wrote:
> Jeff,
>  I have never used Wscript and know nothing about it.
>  Anyway, I tried it almost exactly as you suggested:

>  Function test()

You are aware that Lua is case-sensitive?

( should be function, not Function )

>  However, nothing happened when running test()...?

Maybe try this:

function test()
 local err
 local vb="test.vbs"
 local f,err=io.open(vb)
 if err then
  msgbox(err)
  return
 end
 f:write("WScript.Sleep(1000)\n")
 err=f:close()
 if err then
  msgbox(err)
  return
 end
 for i=1,10 do
   msgbox("Execute=".. (os.execute(vb) or "unknown"))
 end
end


 - Jeff