Re: Re: Service doesn’t work after sleep

Home Forums Discussions Support Portal Service doesn’t work after sleep Re: Re: Service doesn’t work after sleep

#7005

couttsj
Participant

All attempts to get the service to reactivate itself failed. All attempts to get the restart service option to do the job resulted in a hung service manager thread with a status of “Stopping”. In order to restart an application, I would normally pass control and a handle to a second program or script to kill the application, wait an appropriate period, restart the application, and then kill the second application itself. Being a service, this approach was not too appealing, but the following code did the job after it detected no ethernet traffic:
Service1.Connect ‘This command stops the service?
Shell (“net start ServiceName”) ‘This command starts the service!
The System event log shows the service being stopped and then started with the same time stamp. 2 seconds later, my own log file shows the service actually being started. This is the first time I have ever got an application to restart itself, and I can’t explain how or why.