DDNSUpdater/bin/install_ddnsupdater_service.bat

24 lines
563 B
Batchfile
Raw Normal View History

@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
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