Jump to content

Autoit & php


Stooney
 Share

Recommended Posts

With php you can run a php script in the commands prompt via

c:\xampp\php\php.exe "c:\path\to\script.php"

I have a script I need ran once a minute on my server. Right now I use the windows task scheduler to do it which technically works, but every minute it brings up an ugly command prompt window for about 5 seconds (or the duration of the script). Is there a way to use autoit to both run the command every x seconds (I will have it startup with windows in the event of a server restart - rare) and not ever bring up an ugly cmd prompt window?

In short I'm looking for a way to have a cmd ran in the cmd prompt every x seconds without the cmd prompt window popping up. Thanks for any help :)

Link to comment
Share on other sites

  • Moderators

Local $i_timedelay = 60000
Local $s_app_name_location = "c:\xampp\php\php.exe"
Local $s_command_line = "c:\path\to\script.php"
While 1
    Run('"' & $s_app_name_location & '" "' & $s_command_line & '"', "", @SW_HIDE)
    Sleep($i_timedelay)
WEnd

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...