Sign in to follow this  
Followers 0
amakrkr

Running php script ....

11 posts in this topic

Hello all,

what am i trying to do is ... run .php script with my Autoit program.

So far i came up with this which obviousely dont work:

Run("c:\php\php script.php")

Anyone has any suggestions?

I think the problem is that Run command executes php.exe and then stops. I have also tried with "php.exe " & "script.php" and still doesnt work...

Thank you for your help!

Share this post


Link to post
Share on other sites



You need to explain more detail that what the problem is and what the Script says.

Maybe

ShellExecute("c:\php\php script.php")

Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites

Hi,

problem is:

If i open command prompt and i try to execute my PHP script using this command C:\PHP\PHP SCRIPT.PHP it works. But when i copy this command to autoit

like this

Run("c:\php\php script.php")
it doesnt work. Why? I do not know.... i dont get any errors or anything that i could post here.

The only problem there could be is that Run command stops at php.exe and it doesnt take argument script.php.

Sorry for my terrible English >.<

Share this post


Link to post
Share on other sites

PS shellexecute doesnt work as well...

Share this post


Link to post
Share on other sites

like this

Run("c:\php\php script.php")
it doesnt work. Why? I do not know.... i dont get any errors or anything that i could post here.

Try this:

Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE)

AutoIt wants the @ ComSpec & " /c "

Share this post


Link to post
Share on other sites

Try this:

Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE)

AutoIt wants the @ ComSpec & " /c "

hmm still same resoult .... i had to remove @sw_hide so i could see if there would be any errors in CMD.

Now cmd hangs on "c:\windows\system32\cmd.exe" and again doesnt do nothing with php sript.

>.<

Share this post


Link to post
Share on other sites

Try this:

Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE)

AutoIt wants the @ ComSpec & " /c "

Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE)

Or try that :x

It sounds like when php.exe is kicking the working path doesn't know where the php file is.

You could do

Run(@ComSpec & ' /c c:\php\php.exe c:\php\script.php', "C:\php", @SW_HIDE)

Share this post


Link to post
Share on other sites

Only Run is the Start Menu Run. So you can run calc or notepad on Only Run.


Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites

Hello again,

many thanks for replays, this was really frustrating for me :x

Anyway this line posted by ZacUSNYR saved the day:

Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE)

Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE)

Or try that :P

It sounds like when php.exe is kicking the working path doesn't know where the php file is.

You could do

Run(@ComSpec & ' /c c:\php\php.exe c:\php\script.php', "C:\php", @SW_HIDE)

Thanks again for all your replays!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0