lua-users home
lua-l archive

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

In article
<>, Jerome
Vuarand <> wrote:
> 2014-06-23 7:19 GMT+01:00 Michael Gerbracht <>:
> > I would like to use os.execute() to run an .exe file with a path as
> > argument. I tried the following:
> >
> > path = [["C:\program files\lua\lua.exe" "C:\Users\name
> > surname\test.lua"]] print(path) os.execute(path)

> A good rule of thumb on Windows when you run a command through C (which Lua
> uses) and the command contains double quotes, is to surround the whole
> command with an additional pair of double quotes. So your script should
> become:

> path = [[""C:\program files\lua\lua.exe" "C:\Users\name
> surname\test.lua""]]
> print(path)
> os.execute(path)

Thanks a lot, this also works well here!