install bat scripts on windows
This commit is contained in:
parent
8b0e6a28c2
commit
663a92ce33
3 changed files with 40 additions and 10 deletions
|
|
@ -1,24 +0,0 @@
|
|||
@echo off
|
||||
|
||||
set SERVICE_NAME=sunshinesvc
|
||||
set SERVICE_BIN="%~dp0\tools\sunshinesvc.exe"
|
||||
set SERVICE_START_TYPE=auto
|
||||
|
||||
rem Check if sunshinesvc already exists
|
||||
sc qc %SERVICE_NAME% > nul 2>&1
|
||||
if %ERRORLEVEL%==0 (
|
||||
rem Stop the existing service if running
|
||||
net stop %SERVICE_NAME%
|
||||
|
||||
rem Reconfigure the existing service
|
||||
set SC_CMD=config
|
||||
) else (
|
||||
rem Create a new service
|
||||
set SC_CMD=create
|
||||
)
|
||||
|
||||
rem Run the sc command to create/reconfigure the service
|
||||
sc %SC_CMD% %SERVICE_NAME% binPath= %SERVICE_BIN% start= %SERVICE_START_TYPE%
|
||||
|
||||
rem Start the new service
|
||||
net start %SERVICE_NAME%
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
@echo off
|
||||
|
||||
set SERVICE_NAME=sunshinesvc
|
||||
|
||||
net stop %SERVICE_NAME%
|
||||
|
||||
sc delete %SERVICE_NAME%
|
||||
Loading…
Add table
Add a link
Reference in a new issue