Solved

# Scheduled Task on Windows 2003 Server to Hit URL

Posted on 2010-01-05
Medium Priority
893 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
• 3
• 2
• 2

LVL 12

Expert Comment

ID: 26187875
curl www.example.com

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

LVL 9

Expert Comment

ID: 26188093
This maybe simplier:
0

LVL 12

Accepted Solution

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

0

Author Comment

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

ID: 26280610
0

LVL 12

Expert Comment

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

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

## Featured Post

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
###### Suggested Courses
Course of the Month15 days, 9 hours left to enroll