@echo off
cd /d %SystemRoot%

if not exist "%~dp0FQDNUpdate.ps1" (
    echo ERROR: FQDNUpdate.ps1 not found in %~dp0
    pause
    exit /b 1
)

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0FQDNUpdate.ps1"

if %ERRORLEVEL% NEQ 0 (
    echo.
    echo ERROR: PowerShell exited with code %ERRORLEVEL%
)

pause
