2026-03-17 14:25:17 +01:00
|
|
|
@echo off
|
2026-03-17 14:30:49 +01:00
|
|
|
REM Get the folder where this bat is located
|
|
|
|
|
SET SCRIPT_DIR=%~dp0
|
|
|
|
|
|
|
|
|
|
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
|
2026-03-17 14:25:17 +01:00
|
|
|
exit /b 1
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
REM Create the service (auto-start)
|
|
|
|
|
sc create DDNSUpdaterService binPath= "%EXE_PATH%" start= auto
|
|
|
|
|
|
|
|
|
|
REM Start the service
|
|
|
|
|
sc start DDNSUpdaterService
|
|
|
|
|
|
|
|
|
|
echo Service DDNSUpdaterService installed and started.
|
|
|
|
|
pause
|