im trying to get lfs started up using php and windows but ive hit a snag with how lfs finds its files. when my code starts lfs, lfs thinks that its in the php binary folder (in my case C:\Apps\PHPEd\PHP5) and not the same folder as the lfs.exe.
im using com to load up lfs, get the process id and then use a tool to terminate a process using its id. ive tryed creating a shortcut to lfs.exe but the method im using to start lfs reads the .lnk as a file and not a shortcut (then it complains its not a valid win32 exe)
using chdir() php function doesnt work to change the folder lfs starts in.
here is code
here is output
is there a way to execute lfs and tell it what folder to start in, or is this a bug in lfs? (should lfs be settings its working directory to the exe path?)
im using com to load up lfs, get the process id and then use a tool to terminate a process using its id. ive tryed creating a shortcut to lfs.exe but the method im using to start lfs reads the .lnk as a file and not a shortcut (then it complains its not a valid win32 exe)
using chdir() php function doesnt work to change the folder lfs starts in.
here is code
<?php
$Base = "C:\\Documents and Settings\\Jon\\My Documents\\temp\\packages\\";
$LFS = "lfs_s2_full\\default\\";
$WshShell = new COM("WScript.Shell");
echo $Base . $LFS . 'LFS.exe /cfg=setup.cfg';
echo "<br>";
$oExec = $WshShell->Exec($Base . $LFS . 'LFS.exe /cfg=setup.cfg');
$PID = $oExec->ProcessID;
echo "PID: $PID<br>";
sleep(1);
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Exec($Base . "pskill.exe $PID");
echo "terminated $PID";
?>
here is output
is there a way to execute lfs and tell it what folder to start in, or is this a bug in lfs? (should lfs be settings its working directory to the exe path?)