Created
May 13, 2015 07:29
-
-
Save pmolchanov/16daa236aef94a5cf690 to your computer and use it in GitHub Desktop.
Install a service
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
$ServiceExe = "MyService.exe" | |
$ServiceName = "MyService" | |
$ServiceDisplayName = "MyService DisplayName" | |
$ServiceBinPath = [System.IO.Path]::GetFullPath($ServiceExe) | |
& sc.exe delete $ServiceName | |
& sc.exe create $ServiceName binPath= "`"$ServiceBinPath`"" DisplayName= "`"$ServiceDisplayName`"" | |
& sc.exe start $ServiceName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment