Cron Job in PHP on Localhost in Windows | Scheduler in PHP
HTML-код
- Опубликовано: 15 авг 2024
- Running cron job on windows local machine is very easy and by this tutorial you can make it more easy. I have distributed this video in 3 parts 1 is creating the php script, 2nd is creating the bat and vbs file 3rd is adding the task to the scheduler.
Using this you can run your php script automatically. Run your script every 5 minutes or according to your need.
In this video you can also learn how to setup the task scheduler in windows pc
For tutorial and files you can use this URL - www.vivekmoyal...
To be honest, i am really impressed, u deserve some accolades.
Wasnt expecting this to work, but it worked on the first trial, wow.
Thank you
Thank you so much!! My cron job is running successfully in windows.
I think you are an Indian. Anyway! these Indians are great! Thank you!
Still works in 2023 tysm :D
Hi I tried this code but shellscript file not working if i double click on batch file command prompt opens and closes immediately but php code doesn't work. Can you please help.
Life saver
thank you bro. it's very helpful for me. god bless you
Useful video 👍☺️
But I want to delete some row auto delete ... In column value 0,1,2,2,0,1,0 like this I want to delete 0 value row using crop job how I do this?
Sir Please help me !
Working 100% on windows 10 , Thanks
It's working if i run manually it's working. If i schedule with task scheduler it's not working
It is really helpful 👍👍
great .. thank you
👌👌👌👌
Thanks
I copied every code from your site, and changed the paths, however it's not working
How to upload Excel file in the server using this method/cron
ALWAYS INCLUDE YOUR CODE WITH TUTORIALS! No one wants to copy text having to rewind, or play slow to find out if it works. Including code = twice the likes.
Hello Have,
You can find the code in provided url which you can find at the video details. You can copy and paste here
@@vivekmoyalvd There is no URL provided.
@@JaveGeddes You can use this URL - www.vivekmoyal.in/cron-job-in-php-on-localhost-in-windows-scheduler-in-php/
you saved me
video very useful 👍👍👍👍. My computer is off but I still want to upload data to the database it fails because xampp is off how can it take action and xampp is enabled at the same time ?
I am not sure but if you can set anything in your bios then you can do that just like computer clock it always work.
thank you so much
I followed the same step but i get an error when the scheduled task run. "Loading script "C:\WINDOWS\system32\C:\Users\dania\Desktop\shell.vbs" failed (The filename, directory name, or volume label syntax is incorrect)
can you please guide me how to resolve this error?
Please check the file url which you have used in your file.
@@vivekmoyalvd yeah i did
All the url are correct
@@vivekmoyalvd sir the shellscript.vbs file is not running when I double click on it.
@@dani8667 this is the problem .... Please paste the code here
@@vivekmoyalvd
shellscript.vbs code
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "C:\AutoScriptRunner\script.bat" & Chr(34), 0
Set WindScriptHost =Nothing
Thanks for your sharing,
Could I run php script to write excel file?
Yes, you can
basically i need to click the run button to send the email. but the email would not send automatically. is there any way for me to get the email automaticaly
First of all check that your email script is working or not. Then move to the scheduler and create a time period for continues running like 1 minute, 5 minute etc you can find this option in the above video. If you wont set the continues process then it will run the script automatically.
I want to ask u please if your script is working now, because i need to do the same thing and i don't know what to do yet. thank u
Code was already working..... At what part you are facing issue
@@vivekmoyalvd thanks for your reply, but I was talking to @syuhafa azamil because i want to send mails automatically too, so if she/he can help me on that, i'll be so thankful🤗
Hey there please you have to do litle change in you code in .bat file : "C:\xampp\php\php.exe" -f C:\xampp\htdocs\cronproject\autoEntry.php and in vbs file : Set shell = CreateObject("WScript.Shell")
shell.CurrentDirectory = "C:\AutoScriptRunner"
shell.Run "script.bat"
It is giving me error on Line 2 char 1
Have you delete all the code in vbs file or add this?
Please tell me what have you done in vbs file.
My code is not working. When I double click on it then it is not working
Looking forward for your response
Thanks its working but when i try to use it in windows server 2016 its not working. How can i make it work?
What error you are getting...
@@vivekmoyalvd Windows Script host: in the shellscript. Line 2. Char 1. Error: the system can not find the file specified. Code 80070002. Source (null). that is the full error i am getting but in windows 10 its working fine except in server 2016.
@@sehphirry9148 plz chk the below comments someone fixed this issue earlier
@@vivekmoyalvd Okay thank you very much. Nice work by the way.
Now i managed to fix the error but its not in Db using auto schedular
How do I do this on the Cpanel
Use cron jobs
supercalifragilisticexpialidocious
I followed your tutorial but it didn't work, can you help me to solve it?
What error you faced
I followed your tutorial but .vbs file is not working when I double clicked it.
@@jeffersonsarmiento700 is there any error you are facing
@@vivekmoyalvd my PHP code will send an email when I open its file in browser but when I use the .vbs file it didn't work
@@jeffersonsarmiento700 you are using it on your server or localhost
O cara gasta um puta tempo para ensinar Banco de dados 😮