Remotely Restarting a Service Reliably

Home Forums Scripting General Scripting Remotely Restarting a Service Reliably

Viewing 1 post (of 1 total)
  • Author

  • humbletech99

    I need to be able to reliably and remotely restart a service from cmd/batch.

    So far I have been doing

    sc \server stop servicename
    sc \server start servicename

    But because of a timing issue this invariably leaves the service as just stopped. So I introduced a time wait between the two commands, but this doesn’t always work, if the server is slow to respond to the first one, it’s not ready by the time of the second one and the service never restarts.

    Anyone got any good reliable method for restarting a service and making sure it comes back up from cmd/batch?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

13 Email Threat Types to Know About Right Now

As email threats evolve and multiply, keeping track of them all—and staying protected against the many different types—becomes a complex challenge. Today, that requires more than just the traditional email gateway solution that used to be good enough.

In this eBook you will learn:

  • What are the most common and challenging email attacks for organizations?
  • How to defend against sophisticated email threats, such as spoofing, social engineering, and fraud
  • How to protect employees at the inbox level with the right technologies and security-awareness training
  • How to use a multilayered protection strategy to reduce susceptibility to email attacks and better defend your business and employees

Sponsored by: