Hi there I am trying to get my batch file which is located in C:\IBserver\www\cod_start.bat. However i am not exactly sure on how to use the exec() function to launch this batch file so if anyone could help me out please. I have looked at the php manual but that didnt really help
Thanxs.
exec("C:\IBserver\www\cod_start.bat");
Should work...
ok ty ill go and try it now
Ok i did that but now it just takes years to load and i still dont see the batch file launching is there a problem with this as i put in exactly what you said but still nothing shows up but instead of getting an errror jsut takes ages to load.
Does anyone actually have a clue how to use this function because noone seems to reply or know exactly what to do.
ok i have gone back to this now
<?php exec("c:\\IBserver\\www\\cod_start.bat"); ?>
This now works but the inly problem is that it runs in the background and i need it to actually show up.
you can use Exection Operators. These are backticks (ie ` NOT ') and have the effect of sending whatever they enclose to the system and capturing it's output
$output = `c:\\IBserver\\www\\cod_start.bat`; echo $output;
try that
adam
ok ill try it do i replace my exec with this or put that after the exec?
got this error
Fatal error: Maximum execution time of 30 seconds exceeded in c:\ibserver\www\serverpannel\server_start.php on line 10
seems like your batch file is taking longer than 30 seconds.
it may be that the batch isn't outputting anything and the script is not detecting this and so is waiting - not sure how it handles no output situations
well my batch file definatley works and does what its supposed to because i test it out but it may be because the batch file is in the same directory so ill move some stuff around and see what happens
well it all works now apart from it runs in the background and on the server the program is supposed to open up a console window but it opens but is in the background.