Why don't applications in Program Files start using os.execute in lua?

I am trying to run an executable using the Lua function os.execute(). If I do something like the following, it will not work:

os.execute("C:\\\Program Files\\\Movie Maker\\\moviemk.exe")

However, if I put my lua file in the same path that it is in moviemk.exe, it can cause it.

Any ideas why this could be?

PS I am using Windows XP SP3

+3
source share
2 answers

Try:

 os.execute("C:\\Program Files\\Movie Maker\\moviemk.exe")

or

 os.execute("C:/Program Files/Movie Maker/moviemk.exe")

The '\' character is used for escape characters in Lua.

+1
source

. Windows, , * nix , Windows , C:\Program Files.

, , os.execute(str) ANSI C system(str), Windows "cmd /C "..str . ( * nix /bin/sh -c cmd/C.)

, , , , .

: os.execute("C:\\Program Files\\Movie Maker\\moviemk.exe") cmd /c c:\program files\movie maker\moviemk.exe, , CMD c:\program files\movie maker\moviemk.exe. , .

.

:

os.execute [["C:\Program Files\Movie Maker\Moviemk.exe"]]

, . [[...]] , , , .

Windows, * nix, , , , .

, , , \Programs Files C:. C:. ( E:, .) - ProgramFiles. .

+15

Source: https://habr.com/ru/post/1761989/


All Articles