@echo off setlocal set "JNLP_FILE=C:\Path\To\Your\File.jnlp" if not exist "%JNLP_FILE%" ( echo Error: JNLP file not found. exit /b 1 ) rem Call the PowerShell script to perform the replacement powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Path\To\Your\Script\Replace-Line.ps1" -FilePath "%JNLP_FILE%" rem Check the exit code of the PowerShell script if errorlevel 1 ( echo There was an error executing the PowerShell script. exit /b 1 ) else ( echo File updated successfully. ) endlocal