MontySR
asked on
Silently Calling a URL from a scheduled task
Hi,
Background:
Within our asp.net system we have a couple of processes that are required to be schduled. Due to issues with the .net timers and the reluctance of our isp to allow us to setup schdueled tasks on their server, we decided upon a blank webpage that when called with certain parameters will fire events.
Problem:
We developed the above solution with the intention of using a site ripping tool called "HTTrack" to call the url with the respective parameters when it is fired by the timer. However after extensive testing we found that HTTrack always creates 2 connections regardless of the flags passed.
Is there another way to silently call a url using windows task manager, without having IE (or any other application for that matter) popping up on screen. We have tried a host of other approaches including sql jobs, and xp_cmdshell, but they do not seem to work persistently.
Background:
Within our asp.net system we have a couple of processes that are required to be schduled. Due to issues with the .net timers and the reluctance of our isp to allow us to setup schdueled tasks on their server, we decided upon a blank webpage that when called with certain parameters will fire events.
Problem:
We developed the above solution with the intention of using a site ripping tool called "HTTrack" to call the url with the respective parameters when it is fired by the timer. However after extensive testing we found that HTTrack always creates 2 connections regardless of the flags passed.
Is there another way to silently call a url using windows task manager, without having IE (or any other application for that matter) popping up on screen. We have tried a host of other approaches including sql jobs, and xp_cmdshell, but they do not seem to work persistently.
You can use PERL: http://www.perl.com/pub/a/2002/08/20/perlandlwp.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
page = "http://www.msn.com"
parameters ="?emailto=me@domain.com"
returnpage = getURL(page & parameters)
msgbox returnpage
function getURL(url)
if left(url,7)<>"http://" then url="http://"& url
set x = CreateObject("MSXML2.Serve rXMLHTTP")
x.Open "GET",url,true
x.Send()
for n = 1 to 15
If x.readyState = 4 then exit for
x.waitForResponse 1
next
getURL = x.responseText
end function
parameters ="?emailto=me@domain.com"
returnpage = getURL(page & parameters)
msgbox returnpage
function getURL(url)
if left(url,7)<>"http://" then url="http://"& url
set x = CreateObject("MSXML2.Serve
x.Open "GET",url,true
x.Send()
for n = 1 to 15
If x.readyState = 4 then exit for
x.waitForResponse 1
next
getURL = x.responseText
end function
and schedule the above vbs files in windows task manager.
Cheers.
Cheers.
sankar_ravi,
Your code has undeclared variables, calls a superceeded component, has an improper wait loop and displays a mesage box which is hardly silent. Did you just cut that from a web example, because it certainly will not work as posted and doens't add any value to the question thread.
I already mentioned how to schedule the task.
Your code has undeclared variables, calls a superceeded component, has an improper wait loop and displays a mesage box which is hardly silent. Did you just cut that from a web example, because it certainly will not work as posted and doens't add any value to the question thread.
I already mentioned how to schedule the task.
ASKER
Thanks rdivilbiss, solution worked first time. Was exactley what we were after!!
Great!!!
Thanks for the "A"
Thanks for the "A"