I have a Lua script and I want to execute a batch file from within this file; how can I do this?
I've seen examples as follows that I thought could do this but in retrospect I am probably misunderstanding their purpose:
os.execute('C:\\tmp\\MyFile.bat')
or
local handle = io.open('C:\\tmp\\MyFile.bat')
handle:close()
I believe this question has been asked and answered before: How do I run an executable using Lua?
However my code is failing; I'm not sure why. Is there a library I need to load for 'os' for example?
When I try and run this code I get the following error:
"attempt to index a nil value"