473,221 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Run ASP Script as Scheduled Job

Hi All,

I want to perform the simple task of running an ASP script as a scheduled
job.

Previously I've always either run a .vbs script via windows Scheduler, or
put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here)
which mean I can't use either the global.asa or a standalone vbs script for
this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying
to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K server ?

Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.
Jul 19 '05 #1
10 6118

Hi

I suggest lynx for win32 :
http://lynx.isc.org/release/

or Wget :
http://www.gnu.org/software/wget/wget.html

Both are scriptable (.bat file).

Wget allows you to POST data, load precise
cookies, ...

Have a nice day

Maxime Ducharme
Programmeur / Spécialiste en sécurité réseau

"Larry Neylon" <ln*****@nospam.ntlworld.com> wrote in message
news:vU***************@newsfe5-win.ntli.net...
Hi All,

I want to perform the simple task of running an ASP script as a scheduled
job.

Previously I've always either run a .vbs script via windows Scheduler, or
put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here) which mean I can't use either the global.asa or a standalone vbs script for this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying
to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K server ?
Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.

Jul 19 '05 #2
write a .vbs script that uses techniques from
http://www.aspfaq.com/show.asp?id=2173 to retrieve the page. Then schedule
the .vbs script.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Larry Neylon" <ln*****@nospam.ntlworld.com> wrote in message
news:vU***************@newsfe5-win.ntli.net...
Hi All,

I want to perform the simple task of running an ASP script as a scheduled
job.

Previously I've always either run a .vbs script via windows Scheduler, or
put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here) which mean I can't use either the global.asa or a standalone vbs script for this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying
to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K server ?
Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.

Jul 19 '05 #3
On Tue, 07 Sep 2004 20:31:23 GMT, "Larry Neylon"
<ln*****@nospam.ntlworld.com> wrote:
I want to perform the simple task of running an ASP script as a scheduled
job.


See:

How do I schedule ASP files?
http://www.aspfaq.com/show.asp?id=2143

Jeff
Jul 19 '05 #4
Hi Jeff,

It looks like the solutions there involve changing the .asp page to a .vbs,
which I can't do in this example, or using the global.asa timer method,
which yet again is unavailable in this example.

I'll go through the response from Mark to see whether that will provide the
answer.

Thanks,
Larry.
"Jeff Cochran" <je*********@zina.com> wrote in message
news:41*****************@msnews.microsoft.com...
On Tue, 07 Sep 2004 20:31:23 GMT, "Larry Neylon"
<ln*****@nospam.ntlworld.com> wrote:
I want to perform the simple task of running an ASP script as a scheduled
job.


See:

How do I schedule ASP files?
http://www.aspfaq.com/show.asp?id=2143

Jeff

Jul 19 '05 #5
Hi Maxime,

Unfortunatley the server I will need to run this on is hosted by a different
company, who are reluctant to install 3rd party software on their servers
(understandable, given security issues), so I'll have to try and find a
native Windows solution if possible,

Thanks,
Larry.
"Maxime Ducharme" <md*******@cybergeneration.com> wrote in message
news:48p%c.155071$X12.2352@edtnps84...

Hi

I suggest lynx for win32 :
http://lynx.isc.org/release/

or Wget :
http://www.gnu.org/software/wget/wget.html

Both are scriptable (.bat file).

Wget allows you to POST data, load precise
cookies, ...

Have a nice day

Maxime Ducharme
Programmeur / Spécialiste en sécurité réseau

"Larry Neylon" <ln*****@nospam.ntlworld.com> wrote in message
news:vU***************@newsfe5-win.ntli.net...
Hi All,

I want to perform the simple task of running an ASP script as a scheduled job.

Previously I've always either run a .vbs script via windows Scheduler, or put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here)
which mean I can't use either the global.asa or a standalone vbs script

for
this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K

server ?

Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.


Jul 19 '05 #6
On Tue, 07 Sep 2004 20:31:23 GMT, "Larry Neylon"
<ln*****@nospam.ntlworld.com> wrote:
Hi All,

I want to perform the simple task of running an ASP script as a scheduled
job.

Previously I've always either run a .vbs script via windows Scheduler, or
put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here)
which mean I can't use either the global.asa or a standalone vbs script for
this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying
to close window" message and leaves window open)

Let me see if I understand you right.

You have a website on a host (located otherside of the world or
whereever))

From your machine you want to run a ASP file on the host like a normal
user would then close the browser when the job is done. Your machine
will be left on 24 hrs a day so it can run the scheduled job.

If so then the above seems to fine, except for the self.close()
problem.

I have read in the past a way round this, cant remember exactly how it
was done, but it was something to do with the opener property.
Something like:

self.opener = self;
self.close()

actually, I've just tested it and it worked fine:

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
function closeMe() {
self.opener = self;
self.close();
}
</script>
<input type="button" value="Close Me" onclick="closeMe();">
</body>
</html>
Now you just need to work out when to run this in the browser. Might
be as simple as just putting it in the <body onload="closeMe();">
HTH

Al.


Does anyone have any suggestions as to how to achieve this on a W2K server ?

Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.


Jul 19 '05 #7
Hi Mark,

Thanks for the link. The following code works, but has one problem, which
is really weird:

==============================
Dim url, xmlhttp

url = http://www.myserver.com/myscript.asp

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

xmlhttp.open "GET", url, true

xmlhttp.send ""

MsgBox "Complete"

set xmlhttp = nothing

==============================

If the MsgBox is excluded the asp script on the server doesn't execute
correctly, but if I add the MsgBox the script runs exactly as I want it to.

Has anyone come across WSH behaviour that is dependent on a MSGBOX statement
?

Thanks,
Larry.

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:ek****************@TK2MSFTNGP12.phx.gbl...
write a .vbs script that uses techniques from
http://www.aspfaq.com/show.asp?id=2173 to retrieve the page. Then schedule
the .vbs script.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Larry Neylon" <ln*****@nospam.ntlworld.com> wrote in message
news:vU***************@newsfe5-win.ntli.net...
Hi All,

I want to perform the simple task of running an ASP script as a scheduled job.

Previously I've always either run a .vbs script via windows Scheduler, or put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here)
which mean I can't use either the global.asa or a standalone vbs script

for
this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K

server ?

Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.


Jul 19 '05 #8
ljb

"Larry Neylon" <la***@nospam.ntlworld.com> wrote in message
news:OE**************@TK2MSFTNGP14.phx.gbl...
Hi Mark,

Thanks for the link. The following code works, but has one problem, which
is really weird:

==============================
Dim url, xmlhttp

url = http://www.myserver.com/myscript.asp

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

xmlhttp.open "GET", url, true

xmlhttp.send ""

MsgBox "Complete"

set xmlhttp = nothing

==============================

If the MsgBox is excluded the asp script on the server doesn't execute
correctly, but if I add the MsgBox the script runs exactly as I want it to.
Has anyone come across WSH behaviour that is dependent on a MSGBOX statement ?


I suspect you may need to set the third parameter to .open as false. I seem
to recall experiencing some timing issues when I left it asynchronous. From
the MSDN library:

varAsync [optional]
A Boolean indicator of whether the call is asynchronous. The default is True
(the call returns immediately). If set to True, attach an onreadystatechange
property callback so that you can tell when the send call has completed.

LJB
Jul 19 '05 #9
Thanks LJB, that works a treat.

Working code:

============================
Dim url, xmlhttp

url = "http://www.myserver.asp/myscript.asp" ' ASP script to run

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

xmlhttp.open "GET", url, false

xmlhttp.send ""

set xmlhttp = nothing

====================================

Many thanks all who helped,

Larry.

"ljb" <.> wrote in message news:eD****************@TK2MSFTNGP09.phx.gbl...

"Larry Neylon" <la***@nospam.ntlworld.com> wrote in message
news:OE**************@TK2MSFTNGP14.phx.gbl...
Hi Mark,

Thanks for the link. The following code works, but has one problem, which is really weird:

==============================
Dim url, xmlhttp

url = http://www.myserver.com/myscript.asp

Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")

xmlhttp.open "GET", url, true

xmlhttp.send ""

MsgBox "Complete"

set xmlhttp = nothing

==============================

If the MsgBox is excluded the asp script on the server doesn't execute
correctly, but if I add the MsgBox the script runs exactly as I want it to.

Has anyone come across WSH behaviour that is dependent on a MSGBOX

statement
?


I suspect you may need to set the third parameter to .open as false. I

seem to recall experiencing some timing issues when I left it asynchronous. From the MSDN library:

varAsync [optional]
A Boolean indicator of whether the call is asynchronous. The default is True (the call returns immediately). If set to True, attach an onreadystatechange property callback so that you can tell when the send call has completed.

LJB

Jul 19 '05 #10
What EXACTLY does the ASP script do?

Larry Neylon wrote:
Hi All,

I want to perform the simple task of running an ASP script as a scheduled
job.

Previously I've always either run a .vbs script via windows Scheduler, or
put some logic in my global.asa, both of which have worked fine.

Unfortunately there are technical reasons (too complicated to go into here)
which mean I can't use either the global.asa or a standalone vbs script for
this job. It really does have to be an .asp script running in the
application space.

Running a scheduled job that runs the command "explorer
http://www.mydomain.com/myscript.asp" does the job, but will leave a new
window open every day, which will cause problems when sat on a remote
server. (self.close() at the end of the script just gives the "app trying
to close window" message and leaves window open)

Does anyone have any suggestions as to how to achieve this on a W2K server ?

Some kind of opening IE, running script, closing IE via VBS maybe ?

Any help much appreciated,

Regards,
Larry.

Jul 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ward Germonpé | last post by:
Hi, Is it possible to schedule a php script so that it runs every 5 minutes ? I'm using W2K. thx Ward
0
by: Saurabh Agarwal | last post by:
Hi all, I had scheduled a script using cron and got pid of it when it is running as it is running for a long time.The script is somewhat like cmd sleep 10 cmd2 sleep 20 ... This is...
3
by: Harlin Seritt | last post by:
Hi, I have a script.py that is converted to .exe using py2exe. From another script I call script.exe and would like to be able to run this script.exe in the background (as well as in console --...
2
by: Guoqi Zheng | last post by:
Dear sir, My client asked me to write a small ASP application for them. I have finished the job, however, I am now having a problem during the delivery. This application needs to be installed...
1
by: TiredOfSpam | last post by:
I have an ActiveX Script task in a DTS package which executes fine within DTS. However, if I run it as a sheduled job, it fails with a 'path not found error'. I've cut the code down to the...
4
by: Myth of Sisyphus\). | last post by:
I wish to run this script daily. Can this be scheduled? backup log shipmateDB with truncate_only G
5
by: Pawel_Iks | last post by:
How to write script which will be run automaticaly on server at some dates (for example on each monday at 5 pm)? Is it possible to do it?
2
by: korean_dave | last post by:
Does anyone know how to properly kick off a script using Windows Scheduled Task? The script calls other python modules within itself. HERE'S THE CATCH: I am used to running the script directly...
0
by: Andreas Tawn | last post by:
Does anyone know how to properly kick off a script using Windows Import os and add os.system("pause") at the end of AutomatedTestRun.py to keep cmd open. As far as not seeing any output, I...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.