?
Solved

Scheduled Task on Windows 2003 Server to Hit URL

Posted on 2010-01-05
7
Medium Priority
?
893 Views
Last Modified: 2012-08-14
We need to run a scheduled task every day at 8:00 PM that will simply hit a URL http://www.example.com.  I dont need to post anything, but merely to simulate someone opening up a browser, visiting http://www.example.com and then closing the browser.  However, in my case, I do not even need the browser window to open, I just need to hit the URL to run a report.  

What is the best way to do this?  Perhaps a script can be written that I then call instead?  Are there any examples of such a script?
0
Comment
Question by:archangelman
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Expert Comment

by:larsrohr
ID: 26187875
One way would be to download cURL for Windows (http://curl.haxx.se/download.html), and set up a scheduled task to run a batch file containing the command:
  curl www.example.com

(or C:\path\to\curl www.example.com)
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26188093
This maybe simplier:
Run:  iexplore www.google.com
Put this into your schedule task
0
 
LVL 12

Accepted Solution

by:
larsrohr earned 2000 total points
ID: 26280579
With iexplore, you are actually opening an Internet Explorer window (and leaving it there).  I take it from the question that this is not desired.

With curl, you are just "reading" the html from the remote website -- just accessing the page.  Running "C:\path\to\curl.exe www.example.com" will at most open a command window to display the output, and then close.  Such output is easily suppressed within a batch file, e.g. by running "C:\path\to\curl.exe www.example.com >NUL".
@ECHO OFF
C:\Users\larsrohr\Downloads\curl-7.19.4-win64-nossl\curl.exe www.example.com >NUL

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:archangelman
ID: 26280603
larsrohr:

You are correct.  So I could just download and install curl, and then create a file.bat that has code smilar to the above, right?

In your code, you have a ">NUL"   Is that correct or should it be ">NULL"
0
 
LVL 9

Expert Comment

by:magicdlf
ID: 26280610
Just want to mention that you can close the IE window in the schedule task. Anyway, glad to see you already have your answers.
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 26280630
">NUL" is correct.
">NULL" will save the output into a file named "NULL".

The curl download is just a zipped-up file; no installer to run.  So it's easy to copy curl.exe to wherever you want.
0
 

Author Closing Comment

by:archangelman
ID: 31673346
Thank you very much!  I really like CURL!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
Experts-Exchange users below are the steps you can follow to upgrade your Lync server to latest CU's or cumulative updates. Note: Perform it during non-production hours.   Step 1: Backup your lync and SQL server database. Follow below article: h…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question