【发布时间】:2013-02-12 12:22:40
【问题描述】:
我正在尝试在 Windows 中使用 PHP 的 popen() 函数运行 exe 文件。一切都很完美,除非我的 .exe 文件的路径中有空格。 所以这行得通:
popen("start /b D:\\test.exe", r);
这不是:
popen("start /b D:\\path with space\\test.exe", r);
通常在 CMD 中,当您想要这样做时,只需将路径放在引号中,例如:“D:\path with space\test.exe”,这适用于 exec() 函数,但不适用于 popen()。
我试过了:
popen('start /b "D:\\path with space\\test.exe"', r);
但它不起作用。
有人知道怎么做吗?
【问题讨论】:
-
你的 PHP 版本是多少?