Jump to content

Running php script ....


amakrkr
 Share

Recommended Posts

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!

Link to comment
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 >.<

Link to comment
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)
Link to comment
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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...