Fixed install service bat file
This commit is contained in:
parent
f50ae19805
commit
59ba823865
@ -1,12 +1,18 @@
|
|||||||
@echo off
|
@echo off
|
||||||
REM Check if a path parameter was provided
|
REM Get the folder where this bat is located
|
||||||
IF "%~1"=="" (
|
SET SCRIPT_DIR=%~dp0
|
||||||
echo Usage: install_ddns_service.bat ^<path_to_exe^>
|
|
||||||
|
REM Define the service exe path (same folder as bat)
|
||||||
|
SET EXE_NAME=DDNSUpdater.exe
|
||||||
|
SET EXE_PATH=%SCRIPT_DIR%%EXE_NAME%
|
||||||
|
|
||||||
|
REM Check if the exe exists
|
||||||
|
IF NOT EXIST "%EXE_PATH%" (
|
||||||
|
echo ERROR: %EXE_NAME% not found in the same folder as this script.
|
||||||
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
SET EXE_PATH=%~1
|
|
||||||
|
|
||||||
REM Create the service (auto-start)
|
REM Create the service (auto-start)
|
||||||
sc create DDNSUpdaterService binPath= "%EXE_PATH%" start= auto
|
sc create DDNSUpdaterService binPath= "%EXE_PATH%" start= auto
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user