Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does a service communicate with a script?

Status
Not open for further replies.

HoustonGSC

IS-IT--Management
May 11, 2007
13
US
I have a filewatcher VBscript that I want to set up as a service. I have found where you can use SERVANY.EXE to do this.

Current process: The filewatcher script reads a .ini file to determine which folders/files to process. There is also a flag in the .ini file that tells the filewatcher to either process or stop processing (shutdown).

My question is: If I convert this script to a service, what happens when someone requests the service to stop? Will the script be abruptly stopped? Is there something that I have to put in my code to allow the service mechanism to communicate with the script or can the stop request reset the flag to the stop processing value?

 
If the script were a service, it would terminate execution as soon as the service is stopped.

With the 100's of users that logon to our machine each month, I found it necessary to help clean out those "obsolete" profiles to try and maintain computer performance. I wrote a script and converted in to a service. Unless someone turns the service off, it runs constantly and consistently.

-Geates
 
That's good to know. From your comment, it appears there is no "graceful" method to end the program if it is run as a service.

I'll probably just continue to run it from our scheduler and control it via the ini file then.

Thanks for responding.
Gil.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top