我遇到以下脚本的问题:
$ exec('mode con /status', $tmp); print_r($tmp);
它运行命令并给我结果,但我也得到每次错误消息:
The system cannot find the path specified.
我只想获得终端窗口大小$COLS
x $ROWS
二手系统:PHP 5.4 + Win7
此处的测试结果:
C:\@home\Devel>C:\php\php.exe -v
PHP 5.4.13 (cli) (built: Mar 15 2013 02:05:59)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans
C:\@home\Devel>C:\php\php.exe -r "exec('mode con /status', $tmp); print_r($tmp);"
The system cannot find the path specified.
Array
(
[0] =>
[1] => Status for device CON:
[2] => ----------------------
[3] => Lines: 1200
[4] => Columns: 160
[5] => Keyboard rate: 31
[6] => Keyboard delay: 0
[7] => Code page: 775
[8] =>
)
如何摆脱此错误消息!?!
感谢。