Finding Win CMD columns (gives result+error)

tommyjam

New Member
I have problem with following script:\[code\]$ exec('mode con /status', $tmp); print_r($tmp);\[/code\]It runs the command and gives me result, but also I get every time error message too:\[code\]The system cannot find the path specified.\[/code\]I just want get terminal window size \[code\]$COLS\[/code\] x \[code\]$ROWS\[/code\]Used system: PHP 5.4 + Win7Test results here:\[code\]C:\@home\Devel>C:\php\php.exe -vPHP 5.4.13 (cli) (built: Mar 15 2013 02:05:59)Copyright (c) 1997-2013 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick RethansC:\@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] =>)\[/code\]How can I get rid of this error message!?!Thanks.
 
Top