NSH: Stop Service and Wait

Version 2

    Sometimes a Windows service will take longer than the default timeout to stop.  Whether you try stopping a service using a command, BLPackage, or script, a simple 'net stop' command isn't always sufficient.


    The attached script will send the 'net stop' command to the remote host, and then query the service until that service is fully stopped.  As input you specify the internal service name, number of attempts to query the service, and time between each attempt.