# Autoit & php

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

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

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.

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

## Create an account

Register a new account