What’s the easiest programmatic way to restart a service on a remote Windows system? Language or method doesn’t matter as long as it doesn’t require human interaction.
What’s the easiest programmatic way to restart a service on a remote Windows system?
Share
As of Windows XP, you can use
sc.exeto interact with local and remote services. Schedule a task to run a batch file similar to this:Make sure the task runs under a user account privileged on the target server.
psservice.exefrom the Sysinternals PSTools would also be doing the job: