Solved

# Scheduled Task on Windows 2003 Server to Hit URL

Posted on 2010-01-05
859 Views
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?
0
Question by:archangelman

LVL 12

Expert Comment

curl www.example.com

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

LVL 9

Expert Comment

This maybe simplier:
0

LVL 12

Accepted Solution

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

Author Comment

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

0

LVL 12

Expert Comment

">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

Thank you very much!  I really like CURL!
0

## Featured Post

On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…