Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Running a scheduled task to open browser and point to URL



9:58 pm on Mar 14, 2007 (gmt 0)

5+ Year Member

We're running IIS 6.0 on a windows 2003 server.

We installed a new newsletter script on one of our websites and we need something to browse to a certain URL every 1-2 hours. Basically, once a browser loads the specific URL the script will start on the server and check if it needs to send out any emails.

I can create a task in windows that opens an instance of IE which automatically loads the page we need... but I believe this will only open IE and we would need to manually log into the server and physically close all instances of IE (right?).

Is there a simple way on our server to load a certain website page every couple of hours?

If not, does anyone have any recommended 3rd part hosted solutions that will automatically do what we need every few hours?


11:14 pm on Mar 14, 2007 (gmt 0)

10+ Year Member

In your script file you can use the scripting host to use "SendKeys", which will send keyboard commands. So you can send Alt+F, C to close the browser window.


11:50 pm on Mar 14, 2007 (gmt 0)

5+ Year Member

Thank you for the reply,

I'm actually not using a script file. I just created a shortcut to IE and added the URL to the shortcut.

I'm assuming you're referring to creating a JS file of some sort which when called will open IE, open the website, and then close IE. Right?

If so... how would I go about creating this file? Any links to some good resources?


2:19 am on Mar 15, 2007 (gmt 0)

10+ Year Member

The best example that I've found is from devguru [devguru.com...]

This will probably work for you, which you could then use task scheduler to fire it off.

Simply create a text file called myscript.vbs (vbscript) and edit in notepad.

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "iexplore http://www.example.com", 9
WScript.Sleep 10000 ' Give ie some time to load

'Close the browser
WshShell.SendKeys "%F"
WshShell.SendKeys "C"

You might also be able to use some jscript on the web page to close the window after a certain amount of time.

Is your site and database on a hosted server? If you have control over it, I would probably make a windows service or scheduled SQL job to do the same thing that your web page is doing.

[edited by: TheNige at 2:22 am (utc) on Mar. 15, 2007]


11:05 am on Mar 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Do a quick re-write of the ASP page to a WSH*-based vbscript, and schedule that. Should be easy, and avoids all the messing about with launching a web browser.

*WSH = Windows Script Host; allows you to run ASP-like code as a stand-alone script.


11:36 am on Mar 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

You could schedule a vb script to use xmlhttp to make a get or post to the asp page, that way you dont need to worry about opening/closing the browser or allowing shell automation.


2:44 am on Mar 20, 2007 (gmt 0)

5+ Year Member

Thank you for the replies everyone.

I don't know enough to do a lot of the things you guys suggested.

However... I've purchased another mailinglist software script and the developer had an addon that did I think what the person above stated. It runs as a service on the server and logs into the database based on settings I have set in an XML file. It checks at a set interval to see if any mailings need to be set... works perfect!

Thank you again for everyone that tried to help me out. :)


Featured Threads

Hot Threads This Week

Hot Threads This Month