473,434 Members | 1,430 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,434 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 6153

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
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.