homepage Welcome to WebmasterWorld Guest from 54.145.183.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Running a scheduled task to open browser and point to URL
midoriweb

5+ Year Member



 
Msg#: 3282171 posted 9:58 pm on Mar 14, 2007 (gmt 0)

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?

 

TheNige

10+ Year Member



 
Msg#: 3282171 posted 11:14 pm on Mar 14, 2007 (gmt 0)

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.

midoriweb

5+ Year Member



 
Msg#: 3282171 posted 11:50 pm on Mar 14, 2007 (gmt 0)

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?

TheNige

10+ Year Member



 
Msg#: 3282171 posted 2:19 am on Mar 15, 2007 (gmt 0)

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]

mattur

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3282171 posted 11:05 am on Mar 15, 2007 (gmt 0)

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.

aspdaddy

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3282171 posted 11:36 am on Mar 16, 2007 (gmt 0)

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.

midoriweb

5+ Year Member



 
Msg#: 3282171 posted 2:44 am on Mar 20, 2007 (gmt 0)

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. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved