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 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?
archangelmanAsked:
Who is Participating?
 
larsrohrCommented:
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
 
larsrohrCommented:
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
 
magicdlfCommented:
This maybe simplier:
Run:  iexplore www.google.com
Put this into your schedule task
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
archangelmanAuthor 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
 
magicdlfCommented:
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
 
larsrohrCommented:
">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
 
archangelmanAuthor 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.

All Courses

From novice to tech pro — start learning today.