Created
March 15, 2017 20:19
-
-
Save Andrey2G/fd171596e894ad4162b79e3bd94d1d8d to your computer and use it in GitHub Desktop.
Powershell: Services: support Automatic (Delayed Start)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://msdn.microsoft.com/powershell/reference/5.1/microsoft.powershell.management/Set-Service | |
#There is no option Delayed autostart in StartupType | |
#possible solutions: | |
#1. start sc | |
$Service="My service" | |
sc.exe Config $Service Start= Delayed-Auto | |
#2. set corresponded property in regedit | |
#see https://blogs.technet.microsoft.com/askperf/2008/02/02/ws2008-startup-processes-and-delayed-automatic-start/ | |
Set-ItemProperty -Path "Registry::HKLM\System\CurrentControlSet\Services\$Service" -Name "DelayedAutostart" -Value 1 -Type DWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment