Last active
August 6, 2017 14:47
-
-
Save vgerbase/2abbd52e30934959e5d937c420f7193b to your computer and use it in GitHub Desktop.
Create a dependency on a Windows service
This file contains hidden or 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
@Echo Off | |
Cls | |
:CheckServiceName | |
If "%~1"=="" Goto AskServiceName | |
Set Service=%~1 | |
Goto CheckDependencyServiceName | |
:AskServiceName | |
Echo Enter the service name | |
Set /p Service= | |
If "%Service%"=="" Goto Error | |
:CheckDependencyServiceName | |
If "%~2"=="" Goto AskkDependencyServiceName | |
Set DependencyService=%~2 | |
Goto Process | |
:AskkDependencyServiceName | |
Echo Enter the dependency service name | |
Set /p DependencyService= | |
If "%DependencyService%"=="" Goto Error | |
:Process | |
sc config "%Service%" depend= "%DependencyService%" | |
Pause | |
Goto :eof | |
:Error | |
Echo Sintax: DependencyService.bat Service DependencyService | |
Echo. | |
Pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment