# Scheduled Task on Windows 2003 Server to Hit URL

We need to run a scheduled task every day at 8:00 PM that will simply hit a URL http://www.example.com.  I dont 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?
###### Who is Participating?

Commented:
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

0

Commented:
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

Commented:
This maybe simplier:
0

Author Commented:
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

Commented:
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

Commented:
">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 Commented:
Thank you very much!  I really like CURL!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.