Simplest way to restart service on a remote computer

后端 未结 11 1931
我寻月下人不归
我寻月下人不归 2020-12-23 13:07

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.

11条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 13:48

    If it doesn't require human interaction which means there will be no UI that invokes this operation and I assume it would restart at some set interval? If you have access to machine, you could just set a scheduled task to execute a batch file using good old NET STOP and NET START

    net stop "DNS Client"
    net start "DNS client"
    

    or if you want to get a little more sophisticated, you could try Powershell

提交回复
热议问题