need a quick and reliable fixlet that will help me start a service that’s currently in a disabled state. Windows 10 environment. Please help, under the gun. Thanks.
Here you go… Change service name to whatever service you’re interested in.
// Checks to see if service Type is Auto
if {start type of service "klnagent" != "auto"}
waithidden cmd /C sc config {"klnagent"} start= auto
endif
// Checks to see if service State is Running
if {state of service "klnagent" = "Stopped"}
waithidden cmd /C sc start {"klnagent"}
endif
2 Likes
direction is correct… but “auto” for “disabled” service is too much. don’t think that it was done without any reasons…
“manual” will be more suitable for one-time-start.
1 Like
Then change “auto” to “demand”… Whatever floats your boat.