用 powershell 實現
Stop-Service -DisplayName "A" -Force
Start-Service -DisplayName "A"
Stop-Service -DisplayName "B" -Force
Start-Service -DisplayName "B"
Stop-Service -DisplayName "C" -Force
Start-Service -DisplayName "C"
你試試吧 我不確定
sc config ServiceA depend= ServiceB/ServiceC/ServiceD/"Service Name With Spaces"
How to add dependency on a Windows Service AFTER the service is installed
Automatic service start up and service dependency