Query Services and Start, Stop, Pause and Continue Services with VBScript

This set of functions will start and stop services on the local machine or remote machines. These functions utilize the “SC” executable which should be in your local computer’s path variable.

If you want to use these functions to query or manipulate the local computer’s services just pass a period (.) as the computer name string.

The ServiceStatus function will return the service’s current status as a string. Examples of possibilities include “started”, “stopped” and “paused” along with a few others. The ServiceControl function will return “true” or “false” based on whether the command was successful or “error” if the control string that was passed was unsupported.

 

Leave a Comment