Hi I test my web on my localhost(winxp+ie8+mysql5.0.51a+PHP 5.2.11+Apache 2.2.13). I want to add some cron job for my php files. I select Pycron. After configuration, I add some command in crontab.txt

* * * * * "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://localhost/test/index1.php.

It is success, it will open IEXPLORE.EXE and load index1.php for every minute. But it still open the IEXPLORE windows, not for close. how to set it automatic finish the php job, then close the IEXPLORE windows? thanks.

I'm assuming you only want to run the php file, and not view the output. So, instead of running it with iexplore, run it with php.exe

Hi, pritaeas. I'm newer to use cron job. would you like to tell me where is the php.exe? Thanks.

Somewhere in you local setup, it depends on whether you installed everything manually, or used a tool like WAMP or XAMPP. Just look for the PHP folder.

Hi, thanks. I find it.

* * * * * "C:\Program Files\PHP5\php.exe" http://localhost/test/index1.php.

But, it is only flashing a bit on the screen(like CMD windows continued about half a second), then nothing happened. the index1.php should insert something into my database for a cron test. but now, there has nothing insert into database. I test index1.php in IE, it can work well. What do you think the problem? my php.exe is bad? Or because I use a wrong cron command code?

try a filepath (c:\...\index1.php) instead of an url

Thanks, pritaeas. my www folder is in e:\ I have tried

* * * * * "C:\Program Files\PHP5\php.exe" e:\www\test\index1.php.

But it also flashing a bit on the screen(like CMD windows continued about half a second), then nothing happened more...
still need your warmly help.

Remove the dot at the end.

Thanks for a quickly replay. this time the php file can work well.
By the way, I also want cron do other orders. can cron run a bat files?

* * * * * "C:\WINDOWS\system32\cmd.exe" e:\www\test\test.bat

It looks fail. 'executing return code =-1073741510'
And how many files can a cron run at the same time? for example in 19:45, I want run 15 php files, will it cause a heavy pressure for the web server?

Won't the bat file execute just fine without the cmd ?

Depends on what those 15 files do.

but how to write? there have two blanks need to write: command and paramente.
I write C:\WINDOWS\system32\cmd.exe in 'command', and write 'e:\www\test\test.bat' in paramente.
15 files all do something with database. read the database and create html pages.

Move bat to command, and no parameters.

Thanks, you teach me more. now I solve my problems.

No problem. Please mark this thread solved.

Hi, how to mark a thread to be solved?

There should be a button/link somewhere in this thread labeled "mark as solved".

I'm sorry I still not find. here is a screenshot of this thread.
screenshot

The link is at the bottom, in the text just above the reply area.

Thanks, I see it. and clicked it. Good night pritaeas.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.