Simplest way to restart service on a remote computer

后端 未结 11 1930
我寻月下人不归
我寻月下人不归 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 14:06

    I believe PowerShell now trumps the "sc" command in terms of simplicity:

    Restart-Service "servicename"
    

提交回复
热议问题