note 29479 added to language.operators.execution

From: Date: Fri, 14 Feb 2003 15:12:54 +0000
Subject: note 29479 added to language.operators.execution
Groups: php.notes 
Request: Send a blank email to php-notes+get-43940@lists.php.net to get a copy of this message
In Windows it appears you can only call an executable file that resides in the system path which is defined by Windows. As a workaround you can place a batch file in the system path that calls the program from it's dir. Just make sure to use short MS-DOS file and dir names. For example: If you were calling the file c:\program files\my program\program.exe do this: mybat.bat look like this: _________ @echo off c:\progra~1\myprog~1\program.exe _________ Save mybat.bat in c:\ or c:\windows or any other dir in the system path as defined by windows. Then in php call the batch file: _________ <?php $test = c:\mybat.bat; echo "<pre>$test</pre>"; ?> _________ That should do it. Of course this will only work for a program you can run from the MS-DOS command prompt, but (as I understant it) that goes for any executable you call with PHP anyway. Tested in Win98 running Apache 1.3.27 and PHP 4.3.0 -- http://www.php.net/manual/en/language.operators.execution.php http://master.php.net/manage/user-notes.php?action=edit+29479 http://master.php.net/manage/user-notes.php?action=delete+29479 http://master.php.net/manage/user-notes.php?action=reject+29479

« previous php.notes (#43940) next »