Sign in to follow this  
Followers 0
Stooney

Autoit & php

3 posts in this topic

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 :)

Share this post


Link to post
Share on other sites



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


[center]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.[/center]

Share this post


Link to post
Share on other sites

I love you :)

I really think I'll learn autoit now. Was gonna go back to c++ now that I've got php down (enough to run a web dev business), but I think autoit will come first now. C++ can wait a bit longer.

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