Sometimes we need to call/execute some task or program on every x minute/hour/daily etc. for example take daily backup or call daily attendance service or delete temp file etc. we can do manually but its looks like labor work or we can say boring task, to do this we can create schedules with help of Powershell.
1. Open Task Scheduler.
2. Click on Task Scheduler Library > Create Task…
3. Enter some meaningful names and select the radio button as per choice.
- Runs only when you logged in.
- Runs whether you’re logged in or not.
4. Now time to set time when you want to run/execute this scheduler.
Click on Trigger > New… and select time as per requirements.
5. Set Program and URL which you want to call.
- Action:
Start a program
- Program/script:
powershell.exe
- Arguments:
-Command "Invoke-WebRequest YOUR-URL"
- Click on OK button.
Click the OK button till the below window.
Done, on set time your URL will call and you can check “Last Run Time” and “Last Run Result” to clearify.
how do we add parameters (e.g. date) to this url being passed
Great one..
Though it is small thing, but surely helps people checking for a solution to call api from task scheduler.
Thank you for saving my time.
Thanks for the feedback
Hello, can i invoke two diff webpages by one scheduler ?
THANK YOU!!! THAT WAS AWESOME BRO.
My partner and I absolutely love your blog and find the majority of your post’s to be exactly I’m looking for. can you offer guest writers to write content for yourself? I wouldn’t mind producing a post or elaborating on a lot of the subjects you write with regards to here. Again, awesome web log!