@echo off setlocal set "remoteVersionFile=https://chukyso24h.com/tool/saveinvoice/version.txt" set "remoteExecutable=https://chukyso24h.com/tool/saveinvoice/satellite-installer.exe" set "localVersionFile=.\version.txt" set "localExecutable=.\satellite-installer.exe" :: Get the remote version for /f %%A in ('curl -s %remoteVersionFile%') do set "remoteVersion=%%A" echo remoteVersion is %remoteVersion% :: Get the local version for /f "delims=" %%A in ('type %localVersionFile% 2^>nul') do set "localVersion=%%A" echo localVersion is %localVersion% if not "%remoteVersion%"=="%localVersion%" ( echo Downloading new executable... curl -o new_version.txt %remoteVersionFile% echo Replacing old version with the new one... move /y new_version.txt %localVersionFile% echo New version downloaded and installed successfully. curl -o new_satellite-installer.exe %remoteExecutable% echo Replacing old executable with the new one... move /y new_satellite-installer.exe %localExecutable% echo New executable downloaded and installed successfully. ) :: Run the executable %localExecutable% endlocal