Fixed install service bat file

This commit is contained in:
Hamza Zakaria 2026-03-17 14:30:49 +01:00
parent f50ae19805
commit 59ba823865

View File

@ -1,12 +1,18 @@
@echo off
REM Check if a path parameter was provided
IF "%~1"=="" (
echo Usage: install_ddns_service.bat ^<path_to_exe^>
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
)
SET EXE_PATH=%~1
REM Create the service (auto-start)
sc create DDNSUpdaterService binPath= "%EXE_PATH%" start= auto