Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: can we call a batch file from PHP?


Message #1 by "arunm" <arun@l...> on Mon, 24 Dec 2001 12:14:04
Well, if your script works from the command prompt, then it should work with
system(), passthru(), and exec().  I'd recommend doing this:

<pre>

<?php
   passthru("your script filename here");
?>
</pre>


That will show you the output of attempting to run the script from within
PHP.  Odds are that your script is executing, but isn't running in the
working dir that you expect.

Good luck

nik


-----Original Message-----
From: arun [mailto:arun@l...]
Sent: Tuesday, December 25, 2001 10:02 PM
To: professional php
Cc: aalang@r...
Subject: [pro_php] can we call a batch file from PHP?


---
Need a present for your favorite programmer?
E-Documents from Amazon.com at http://p2p.wrox.com/edocs.asp
---
hi
thanks for the reply.
Using the exec() command i am able to call a single command.
I have 4 commands for executing, so i created a script file and tried to
pass it to exec() function but it is not executing.
How can a script file be executed?? is there any seperate function for that.

regards
arun
----- Original Message -----
From: "Adam Lang" <aalang@r...>
To: "professional php" <pro_php@p...>
Sent: Monday, December 24, 2001 7:15 PM
Subject: [pro_php] Re: can we call a batch file from PHP?


> ---
> Need a present for your favorite programmer?
> E-Documents from Amazon.com at http://p2p.wrox.com/edocs.asp
> ---
> yes.  use the exec() function
>
> Adam Lang
> Systems Engineer
> Rutgers Casualty Insurance Company
> http://www.rutgersinsurance.com
> ----- Original Message -----
> From: "arunm" <arun@l...>
> To: "professional php" <pro_php@p...>
> Sent: Monday, December 24, 2001 12:14 PM
> Subject: [pro_php] can we call a batch file from PHP?
>
>
> > ---
> > Need a present for your favorite programmer?
> > E-Documents from Amazon.com at http://p2p.wrox.com/edocs.asp
> > ---
> > hi all,
> > Can a batch file be called from PHP code?
> >
> >
>
>
>
>
>




  Return to Index