Created
January 7, 2025 13:36
-
-
Save swaters86/64c7a62abcbb4f56d2da176194889c27 to your computer and use it in GitHub Desktop.
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
# Replace placeholders with appropriate values | |
$serviceName = "YourServiceName" | |
$displayName = "Your Service Display Name" | |
$description = "This is the description of the service." | |
$executablePath = "C:\Path\To\YourExecutable.exe" | |
# Create the service | |
sc.exe create $serviceName binPath= "\"$executablePath\"" DisplayName= "\"$displayName\"" | |
# Add a description (optional but recommended) | |
sc.exe description $serviceName "$description" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment