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