newObjects Script Service is a
simple but powerful FREEWARE tool. It allows you to write Windows
NT/2000 service in script (VBScript, JScript etc.). What is the effect? You have your script
running. It receives calls to a procedure called "OnTimer"
on configured intervals (up to this point this is simply a scheduler),
but also any external application is able to call functions
implemented in this script! Thus you are able to write something that
receives requests for asynchronous execution and then ask it from time
to time for their state. If you have problems how to implement
maintenance pages for DB management (regular tasks), or news mail
sending, or other tasks not possible to happen during the ASP page
execution - then this is what you need.
Supported platforms: Windows 98/ME/NT/2000. XP support will be added shortly
How it works?
You are registering the scpsvc.exe to run in service mode. Then you
need to write a few lines of configuration - what script to load, in
which language is it, set a log file, set timer interval. Then you can
start the service. The script is loaded and its OnTimer sub is called
each time the specified interval has elapsed. VBScript and JScript
have access to the system time thus the interval is not very important
- your script decides when to do something. You implement some tasks
in the script and in OnTimer you need to implement their invocation
for example call one at midnight and call other at noon. Then you can
write other subs and functions intended to be called from your ASP
pages. Their purpose will be to record some tasks to be done or
retrieve information about them and their state. Then your ASP pages that need to
do something that will cause timeout if done in their code will just
call your "add-task" function for example and tell the user
your request has been recorded. Then he/she may come back later and
check if it is fulfilled. Or another scenario - you wrote in a data
base record that should cause some task to be done later (send mail or
management task may be). Then you can prepare another ASP page that
checks its state or invokes it explicitly - to be done immediately by
calling a routine in your script that changes the schedule for it
and/or executes it before returning.
The script running in the service acts just like a system wide
object available for all the applications. They are able to call its
methods, invoke reload (if configuration is changed for example),
share data between each other etc.
The interface is more than simple - only 6 simple methods and one
Sub without parameters you need to implement (without other specific
requirements to it). Everything else - any method accessible for the
other apps on the machine is your own decision - you implement it and
call it from any application. Therefore you decide how many Subs and
functions you need to implement and what they will do. Security? By
default only the local applications will be able to call it and
depending on the default DCOM configuration other apps on your local
net. Script Service obeys the DCOM configuration and is secure no less
than any other COM object.
The documentation is included in the download package. The package
contains also the newObjects ActiveX Pack1
which is used by the service and can be used in your service scripts
and other applications (ASP pages and so on). You do not need to
download ActiveX Pack1 separately, but if you need some samples on it
go to its page and download the ActiveX Pack1.