Mam program ktory odpalam z "wiersza poleceń":
moj_programik.exe plik.txt
Chce go odpalic z poziomu skryptu PHP niestety Windows XP pokazuje mi palec ;(
Probowalem nawet tego :
<?php function windExec($cmd,$outputfile = "C:\tmp.txt"){ // runs a command line and returns // the output even for Wind XP SP2 // example: $cmd = "fullpath.exe -arg1 -arg2" // $outputString = windExec($cmd,"C:\\my_alternate\\path_to\\a_tmp_file.txt"); print "Wnetrze funkcji"; // Setup the command to run from "run" $cmdline = "cmd /C $cmd > $outputfile"; // Make a new instance of the COM object $WshShell = new COM("WScript.Shell"); // Make the command window but dont show it. $oExec = $WshShell->Run($cmdline, 0, true); // Read the file file. $retArr = file($outputfile); // Delete the temp_file. unlink($outputfile); // convert array to string $retStr = implode(' ', $retArr); print "Wnetrze funkcji, koniec"; return $retStr; } $cmd = "moj_programik.exe plik.txt"; $outputString = windExec($cmd,"C:\\my_alternate\\path_to\\a_tmp_file.txt"); ?>Jezeli ktos moze cos polecić w tej materii to proszę o pomoc, jestem nawet gotów dostarczyc moj_programik.exe z plik.txt i zlecic to zadanie za $.
Sebar