Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Automated ASP Script run
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Automated ASP Script run

 Post Reply Post Reply
Author
BgBoY View Drop Down
Newbie
Newbie


Joined: 26 May 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote BgBoY Quote  Post ReplyReply Direct Link To This Post Topic: Automated ASP Script run
    Posted: 26 May 2004 at 5:30pm

Hello,

i wrote a small script to ping all the computers in our network so see which one are online and which aren't ...

Everytime an employee visits the page, the script is run and the results are written to a database ... But now, i want to shedule the page so it is loaded every 5 minutes, indepent from the result page ...

How can i do this ??? Sheduled Tasks  from windows 2000 won't work ... I read i have to do something with the ASP.DLL and Windows Script Host, but i don't get it :) ...

(script to ping is default.asp)

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2004 at 5:33pm
Why won't scheduled tasks work?
Back to Top
BgBoY View Drop Down
Newbie
Newbie


Joined: 26 May 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote BgBoY Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2004 at 5:37pm

Becausesheduled tasks can't run websites from your localhost IIS server. I can execute the asp site itself, but then it opens Frontpage.

(i forgot to mention in my question, is it possible to run it in background, so no window pops up?)

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2004 at 5:48pm

Well you can just set the task to open

iexplore http://www.yourdomain.com/yourtaskpage.asp

that would opena window however, but you could make it spit out a javascript that closes the browser window after execution

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2004 at 7:36pm

To prevent it from opening Front page, you have to changde your file associations - use ie for "open", and fp for "edit". Also add fp to the right-click "open-with" menu.

Back with W2K, I seem to recall running localhost web pages through scripting by executing a shortcut to the file rather than the file itself. Always opened a window though.

One approach that many people use to run scheduled asp scripts that don't produce page output is to get a $2/$3 a month unix account with crontab capability. Execute the page through cron using the Lynx browser and redirect any output to /dev/null.

I use this approach to get and format news feeds once an hour or so. Speeds up the page loads as the user doesn't wait for the feed.

 


Lead me not into temptation... I know the short cut, follow me.
Back to Top
BgBoY View Drop Down
Newbie
Newbie


Joined: 26 May 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote BgBoY Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2004 at 2:46am

Another problem (with the iexplore parameter) is that when you let the javascript close the window, it pops up an dialog box to ask whether the script may close the page or not ... pretty heavy if you aren't on that machine for over 24 hours (you may close all 24 windows then)

any other solutions ? (like the WIndows Scripting Host)

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2004 at 2:53am

You could write your own little utility to do that, in .net it would be something like this

Dim strURL As String = http://www.yourdomain.com

Dim wc As New System.Net.WebClient

wc.DownloadData(strURL)

System.Threading.CurrentThread.Sleep(10) 'Time to wait for (MS)

Back to Top
TYSON View Drop Down
Groupie
Groupie


Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote TYSON Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2004 at 6:25am
Why couldnt you just have a meta refresh in the page and leave the browser window open at the page?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.