为什么程序文件中的应用程序不能在lua中使用os.execute运行? [英] Why won't applications in Program Files run using os.execute in lua?

查看:112
本文介绍了为什么程序文件中的应用程序不能在lua中使用os.execute运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Lua的os.execute()函数运行可执行文件.如果我执行以下操作,将无法正常工作:

I'm trying to run an executable using Lua's os.execute() function. If I do something like the following it does not work:

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

但是,如果我将lua文件放在与moviemk.exe相同的路径中,那么它可以调用它.

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

有什么想法可能会这样吗?

Any ideas why this may be?

P.S.我正在使用Windows XP SP3

P.S. I'm using Windows XP SP3

推荐答案

尝试:

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

或:

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

'\'字符用于Lua中的转义字符.

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

这篇关于为什么程序文件中的应用程序不能在lua中使用os.execute运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆