How to use “sc” to install a service and specify NO ACTION for “subsequent failures” under recovery

前端 未结 2 1451
名媛妹妹
名媛妹妹 2021-02-19 06:12

I created a service in VB.NET and wanted to use the \"sc\" program to install it. (I needed to package it so that someone else in my organization could perform the actual instal

2条回答
  •  不知归路
    2021-02-19 06:40

    I eventually figured out to run the command like this:

    sc failure MyServiceName reset= 86400 actions= restart/15000/restart/30000//1000
    

    Once I did this, and re-openned the service properties GUI, "Take no action" was shown as I wanted it to be.

    After I started writing the question, I did finally find this SO question: https://stackoverflow.com/a/12631379/1812688

    Although, it wasn't in direct response to the question

提交回复
热议问题