0

shell_exec メソッド内のコマンドは、明らかにコマンド ラインで機能します。この方法を Web サーバーで試しましたが、うまくいきません。これをトリガーする方法に関する追加の構文はありますか?

echo shell_exec("'C:\Program Files\Adobe\Reader 10.0\Reader>AcroRd32.exe' /t C:\Documents and Settings\cgcuser\My Documents\Downloads\Documents\sample.pdf \\myserver\myprinter");
4

3 に答える 3

1

バックスラッシュをエスケープする必要があるようです。

また、2 番目の引数は、文字列として囲む必要があるようです。

echo shell_exec("'C:\\Program Files\\Adobe\\Reader 10.0\\Reader>AcroRd32.exe' /t 'C:\\Documents and Settings\\cgcuser\\My Documents\\Downloads\\Documents\\sample.pdf' \\\\myserver\\myprinter");
于 2012-06-18T05:08:24.540 に答える
0

' の代わりに " を使用したため、 \ の代わりに \\ を使用します。

于 2012-06-18T05:07:22.730 に答える